The retrial of former Egyptian president Hosni Mubarak collapsed in Cairo, after the judge recused himself, referring the case to an appeals court to choose a replacement.

Mubarak waved to supporters after he was wheeled into the courtroom for the first session of his retrial on charges of complicity in the killing of demonstrators during the 2011 revolt.

He sat upright on a hospital gurney inside a defendants' cage of iron bars and wire mesh.

His sons Alaa and Gamal and his former interior minister Habib al-Adly, currently held in prison for separate cases, were also in the courtroom alongside him.

Mubarak is the first Arab president to serve a prison sentence.

The 84-year-old, wearing brown-tinted glasses, has not been seen in public since his initial conviction in June 2012.

Unconfirmed reports have emerged several times in the past year suggesting that he was on the brink of death.

He was airlifted by a military helicopter to the court from a Cairo hospital. His two sons and el-Adly were driven from Tora prison.

Judge Mostafa Hassan recused himself from the trial, but did not specify the conflict of interest behind this decision.

Local media reports suggested he might transfer the case to another judge.

Judge Hassan sparked an uproar in October among Egyptian political activists when he ordered the acquittals of 25 Mubarak loyalists who had been accused of organizing a deadly attack during the 18-day revolt in which assailants on horses and camels stormed downtown Cairo's Tahrir Square.

Mubarak and el-Adly's retrial was granted by an appeals court that overturned their life sentences in January.

The presiding judge of that first trial said the prosecution's case lacked concrete evidence and failed to prove the protesters were killed by the police.

If convicted again, the life sentence passed against Mubarak and al-Adly would be upheld. They could also have their sentence reduced or even be acquitted.

It is considered unlikely that they would draw a heavier sentence, like the death penalty.