Mubarak, 85, is in Tora Prison and will remain under detention for another 48 hours during which the prosecution can appeal against the order of his release. (Agencies)
A Cairo criminal court accepted an appeal by the former President against a recent detention order he received, setting him free.
A team of judges from the Northern Cairo misdemeanour court arrived at the high-security Tora Prison where Mubarak is detained to look into the appeal. Mubarak is in the jail's hospital.
Mubarak, who has been on trial since August 2011, has now received release orders in all the cases in which he is investigated, for spending the maximum time in jail for a defendant pending trial.
However, all trials are still ongoing and would continue. He was sentenced to life in prison last year, but a retrial was ordered earlier this year. His next court hearing is scheduled for August 25.
Morsi remains in custody since the army toppled him on July 3, but his supporters have held protests calling for his reinstatement. The ex-president, who ruled Egypt for nearly 30 years, was ousted in the 2011.
Egypt is under a state of emergency amid the bloodshed which has accompanied the interim government's crackdown on Islamists opposed to the army's ousting of Morsi.
Mubarak, 85, is in Tora Prison and will remain under detention for another 48 hours during which the prosecution can appeal against the order of his release.