(CNN) -- The judge in the retrial of deposed Egyptian president Hosni Mubarak recused himself Saturday, referred the trial to a lower court and then walked out of the courtroom.
Other judicial officials left the bench with him.
Egyptian state TV carried the announcement live. A crowd of people attending the trial erupted in angry shouts, and police stepped in between them and the judge's bench.
Mubarak, who had arrived on a stretcher at the country's Police Academy in Cairo for the first day of his retrial, was loaded back onto a helicopter, which flew him back to a military hospital.
Judge Mustafa Hassan Abdullah quit the case over a medical condition, Mubarak's lawyer Farid El Deeb told CNN.
Abdullah "submitted a medical report to the head of Cairo Cassation Court stating that he has medical problems with his eyes," El Deeb said. Egyptian law requires a judge to recuse himself publicly.
A lawyer for the families of those killed said he believed the judge held a legal bias in the case but also corroborated the medical reason for the judge's move. "There was also news that he had medical issues related to his eyes," Khaled Abu Bakr said.
Bakr and El Deeb told CNN that the court of appeals has 60 days to appoint a replacement judge. Mubarak will remain in custody at a hospital, El Deeb said.
Mubarak faces charges related to the killing of peaceful protesters during the Arab Spring uprising that led to his ouster in February 2011.
Dozens of relatives of those killed in Egypt's demonstrations gathered outside the court, state-run Nile TV reported. They were joined by hundreds of pro-Mubarak activists carrying signs of support.
Galal Faisal Ali, whose brother Naser was killed in the uprising, said he fears Mubarak will be found innocent.
"The government is not giving us the moral support we need and they're allowing this circus of a trial to continue. We were hoping for a death sentence but the way it's going, we may see Mubarak free, and his sons free, which means my brother died for nothing," he said.
Magdi Fouda, the main organizer of the pro-Mubarak protest, is a member of a group called "We are sorry, Mr. President." She was joined by a second group called "Sons of Mubarak."
"We are sure Mubarak will be pronounced innocent," she said.
State security forces formed a barrier between the opposing protesters.
Emotions ran high at Mubarak's original trial in 2012, resulting in scuffles between the two sides inside the courtroom and rioting outside.
Mubarak's two sons, six of his security aides and his former interior minister Habib al-Adly all face trial with him. The other defendants had also appeared at the criminal court located inside the academy, state TV reported.
In addition to the alleged killings, all face charges of financial corruption and abuse of power.
Mubarak and al-Adly were both found guilty in the original trial and sentenced to life in prison, but they entered an appeal, which the court accepted. It resulted in the retrial.
Prosecutors have added an additional corruption charge that was not part of the original trial. Mubarak is accused of selling natural gas to neighboring Israel for prices below fair market value. A judge ordered Mubarak held in custody for an additional 15 days.
Morsy pleased about second trial
Essam El-Erian, a senior adviser to Egyptian President Mohamed Morsy, said in January that the government looked forward to a second trial.
"God willed the retrial would take place under Morsy's rule, with new evidence and new defendants," El-Erian said.
Mubarak, who ruled Egypt for 30 years with the help of the military, was found guilty in June 2012 of ordering the killing of protesters and was immediately transferred to Tora prison in Cairo to serve his life sentence.
The 84-year-old has suffered a range of physical problems since he was driven from office in February 2011, following weeks of protests by Egyptians demanding more freedom and reforms.
In December, Mubarak was transferred to a military hospital after suffering a head injury and a bruised chest when he slipped in a prison hospital bathroom, Egyptian state-run media reported.
Journalist Mohamed Fadel Fahmy contributed to this report