Egyptian pro-democracy activist Ahmed Douma was sentenced to three years in jail on Tuesday after he accused the judge of bias and denounced his trial on charges of violence against the state as political.
Douma was a leading youth figure in the 2011 uprising that toppled Hosni Mubarak at the height of the "Arab Spring." He is accused of attacking the cabinet office building and security forces when clashes erupted during a sit-in there in 2011.
Douma also took part in demonstrations that led to the army's overthrow of elected Islamist President Mohamed Morsi in July 2013, but he later mobilized against the military'spolitical role and a law that severely restricts street protest.
Critics at home and abroad have accused Egyptian authorities of using the justice system to silence opponents.
Egyptian government officials say they do not interfere in the judiciary. Under President Abdel Fattah al-Sisi, the general who toppled Morsi, thousands of Muslim Brotherhood members have been jailed and hundreds sentenced to death in mass trials.
Secular and liberal critics such as Douma also have found themselves on the wrong side of Sisi's government, with dozens jailed for taking part in public gatherings.
During Tuesday's hearing, Douma accused the judge, Mohamed Nagi Shehata, of posting comments on Facebook criticizing Egypt's opposition. The comments prompted the judge to sentence Douma to three years in jail and fine him 10,000 Egyptian pounds ($1,399) for"insulting the court."
Last week, Shehata sentenced 185 Muslim Brotherhood supporters to death over an attack on a police station near Cairo last year in which 12 policemen were killed. Shehata also presided over the controversial trial that saw three Al Jazeera journalists jailed for seven to 10 years.
Critics accuse some Egyptian judges of handing down rulings that favor the state against Islamists and secular activists.
After he was sentenced, Douma shouted from his court-room cage, "Down, down, military rule!" Douma's sentence comes days after another Egyptian court dropped criminal charges against Mubarak over the killing of protesters in the 2011 revolt against him.
Many activists say this is the latest of several indications that the old ruling elite is regaining influence.