One of Egypt's most prominent activists, Alaa Abdel Fattah, was released on bail on Monday ahead of his re-trial on charges of violating a protest law, triggering celebrations by dozens of supporters in the courtroom.
Abdel Fattah, a leading secular figure in the 2011 revolt that toppled Egypt's Hosni Mubarak, and other defendants facing similar charges, were freed from a courtroom cage immediately after the judge's ruling and were swamped by friends and family.
A total of 25 defendants - including Abdel Fattah - had been sentenced to 15 years each in absentia in June for violating a law that seeks to curtail demonstrations - legislation branded repressive by rights groups.
Abdel Fattah and two others were later arrested, an event which in Egyptian law prompts a re-trial in the same court.
But the judge, Mohamed Ali al-Fiki, said on Monday he would no longer look into the case and asked that it be transferred to another court. Fiki said he had taken the decision because a lack of respect for the court had put him in an embarrassing position.
The judge did not elaborate but asked the prosecution to investigate how a family video that was unrelated to Abdel Fattah's case had been included as evidence. The airing of the footage at the previous hearing on Sept. 10 had caused uproar among the defendants as it showed a private family celebration.
“Thank god for these decisions,” said Khaled Ali, one of the defense lawyers and a former presidential candidate. “The defense had asked for the court to step aside because of an enmity between the court and the accused.”
Dozens of activists, political detainees and relatives of the defendants had begun hunger strikes in recent weeks to demand their release and call for an end to the protest law.
The law, passed last year, gives the interior ministry the power to ban any public gathering of more than 10 people and has added to fears that freedoms won during the 2011 uprising were being rolled back.
The 15-year sentences were passed almost a year after then-army chief Abdel Fattah el-Sissi overthrew Egypt's first freely elected civilian leader, Mohamed Morsi of the Muslim Brotherhood.
Since Morsi's ouster, security forces have rounded up thousands of Brotherhood supporters, and courts have sentenced hundreds to death in mass rulings that have drawn criticism from human rights groups and Western governments.
But Egypt's secular activists have also found themselves on the wrong side of the new regime.
Abdel Fattah has been in and out of jail since 2011, missing the birth of his child and the death of his father Ahmed Seif al-Islam, one of Egypt's best-known human rights activists.
In a letter to the court during the last hearing, Abdel Fattah asked to be freed on bail to be with his family in their time of grief. Abdel Fattah also asked the judges to step down and allow for a fresh trial in another court.