An Egyptian judge has been reprimanded for speaking out about election fraud in last year's presidential elections.
Judges found themselves at the forefront of the reform debate
In a case that has become a rallying point for the pro-reform movement, Hesham Bastawisi avoided being sacked as a senior appeals court judge.
Another judge in the same case was acquitted at the disciplinary hearing.
Police attacked demonstrators in streets outside the High Court, where the case was heard, arresting dozens and beating protesters to the ground.
In another room at the same courthouse, a judge rejected the appeal of jailed opposition leader Ayman Nour.
Police arrested hundreds of protesters, many from the Muslim Brotherhood group, as others were chased away and beaten.
The group said about 400 of its members were detained - including prominent figures Essam Eryan and Muhammad Mursi - and 180 were injured in the police crackdown.
Many of the beatings were administered by pro-government thugs backed by riot police. They were seen plunging into crowds of demonstrators and beating people to the ground.
"They took those closest to the end while the other demonstrators dispersed," photographer Tara Todras-Whitehill said in comments quoted by Reuters news agency.
"I saw at least 20 people being beaten with fists and kicks and short clubs," she said.
The two judges faced the disciplinary hearing risk after speaking out about violations in last year's presidential elections and could have lost their jobs.
Mr Bastawisi, suffered a heart attack early on Wednesday and was not in court to hear his punishment - reported to be limited to his next promotion being withheld.
The other judge, Mahmoud Mekki, arrived at the court with 10 other judges who make up his defence committee, who were initially barred from entering the courtroom.
After the hearing he told supporters that he was more determined than ever to uphold the independence of the judiciary.
BBC Cairo correspondent Heba Saleh says the decision should ease some of the tensions which have developed over the past month between the judiciary and the government.
The decision should also cool down the political temperature after weeks of protests in support of the judges.
Ayman Nour came out a distant second in the election, and was then sent to prison after being convicted of forgery.
Beatings took place in some of downtown Cairo's main streets
He has been jailed for five years, but he denies the charges and said he was prosecuted to remove him as a political threat to President Hosni Mubarak. The prosecutor-general has denied any political motive.
His sentencing caused the United States to suspend free trade negotiations with Egypt.
Correspondents say both his and the judges' case have cast doubts about the Egyptian government's commitment to political reform.
The EU has criticised Egypt for the way it dealt last week's protests, calling the use of force against protesters " disproportionate".