State TV shows a helicopter flying Hosni Mubarak to a military hospital
Egypt in crisis
What now for Muslim Brotherhood?
Who is who in the Brotherhood
Struggle for Egypt's future
Sinai violence a 'dark omen'
Former Egyptian President Hosni Mubarak has been released from prison after appealing against his detention.
He was flown out of Tora prison in Cairo by helicopter, but is now expected to be put under house arrest.
Mr Mubarak, 85, still faces charges of corruption and complicity in the killing of demonstrators during the protests that toppled him in 2011.
His release is seen by many as a sign that the military is rolling back the changes that flowed from the uprising.
On Thursday, a medical helicopter arrived at Tora, as dozens of Mr Mubarak supporters - some waving flags - gathered outside the prison.
Egypt's TV channel then showed Mr Mubarak being transferred from an ambulance into the helicopter to be taken to a military hospital in Cairo.
This comes after a court ruled on Wednesday that the former leader must be released in a corruption case.
The ruling came during the hearing on charges that the former president had accepted gifts from state-run publisher al-Ahram.
But shortly afterwards, the office of Prime Minister Hazem el-Beblawi said Mr Mubarak would be placed under house arrest after his release.
"In the context of the emergency law, the deputy military commander issued an order that Hosni Mubarak should be put under house arrest," the office said in a statement.
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 Islamist President Mohammed Morsi on 3 July.
Hundreds of members of the Muslim Brotherhood - the movement from which Mr Morsi comes - have been detained, including its most senior leader Mohammed Badie, who was wanted over alleged incitement to violence and murder.
Mr Mubarak was sentenced to life in jail last year for complicity in the killing of demonstrators, but a retrial was later ordered after his appeal was upheld.
That retrial opened in May but Mr Mubarak, 85, has now served the maximum amount of pre-trial detention permitted in the case.