The announcement came hours after a court ordered Mubarak be released for the first time since he was first detained in April 2011, a move threatening to further stoke tension in a deeply divided Egypt. Many feared Mubarak's release would amplify Islamist allegations that last month's military coup was a step toward restoring the old regime.
Prime Minister Hazem el-Beblawi said in a statement that he ordered Mubarak be put under house arrest as part of the emergency measures put in place this month. The decision appeared designed to ease some of the criticism over Mubarak being freed from prison and ensure he appears in court next week for a separate trial.
Prison officials said Mubarak may be released as early as Thursday. It is not clear where Mubarak will be held under house arrest, whether in one of his residences or in a hospital considering his frail health. Since his ouster, Mubarak's supporters have released conflicting details about his health, including that the 85 year old suffered a stroke, a heart attack and at times went into a coma. His critics called these an attempt to gain public sympathy and court leniency.
His wife, Suzanne, has been living in Cairo and keeping a low-profile, occasionally visiting Mubarak and their two sons in prison. But security officials said Mubarak was more likely to be moved to a military hospital because of his ailing health.
The order for Mubarak's release followed an appeal by his lawyers in one of his corruption cases. He is also on trial on charges of complicity in the killing of protesters in the 2011 uprising against him that could put him back behind bars. He faces investigation into at least two other corruption cases as well.
The prospect of Mubarak being freed, even if only temporarily, would feed into the larger crisis bedeviling Egypt: the violent fallout from the July 3 coup that unseated President Mohammed Morsi, an Islamist who became Egypt's first freely elected president following Mubarak's ouster.
Mubarak's release "will cause chaos," said human rights lawyer Nasser Amin. "It will be used by Islamists as proof of the return of the old regime ... and can lead to new alliances between revolutionary groups and political Islam."
El-Beblawi's decision followed an appeal from the youth campaign that spearheaded the petition and protests against Morsi to the interim authorities to use the emergency measures in place earlier this month to keep the former president behind bars.
The group Tamarod blamed Morsi's government for Mubarak's coming release because they said it failed to admit new evidence in the case against the autocrat.
In a statement, Tamarod warned against releasing Mubarak, saying it would be a threat to national security. The group said revolutionary groups "will not stand idle seeing the killers of martyrs get acquitted."
"If it is acquittal for Mubarak today, it will be acquittal for Morsi tomorrow," the group said, vowing to hold a public show trial for Mubarak. "We will not remain silent about freedom for any killer of the Egyptian people."
The three judges who ordered Mubarak be freed met in Tora prison, where he has been held for most of his detention since April 2011. But even before they ruled, human rights advocates have argued for a new system of justice to make up for a shoddy prosecution and a judiciary divided between loyalists of the old regime, Islamists and independents.
Egypt's prosecutor Hesham Barakat told local media that the Wednesday decision was final and his office has no plans to appeal it. A senior prison official, Mostafa Baz, told the private CBC television station that his office will ask the prosecutors on Thursday whether Mubarak is wanted in other cases. If he's not, Baz said the former leader would be freed.
The pro-Islamist camp was waning as its leadership and Morsi himself were arrested. Other high-level officials have been arrested. Despite the crackdown, the pro-Morsi groups vowed to hold massive rallies on Friday.
On the streets of Cairo, interviews about Mubarak highlighted the deep polarization in Egypt, which doesn't always clearly fall into pro-Morsi or pro-military camps.
"This is an absurd charade by the judiciary, the army, and the police in order to reinstate Mubarak and his corrupt regime and to rob the people of their revolution," said Ibrahim Mohammed.
Another Cairo resident, Ahmad Kamal, said it was time Mubarak was set free.
"He should have been released a long time ago. God forgive them for what they have done and the judiciary has ordered this so that should be enough. I have complete faith in the Egyptian judiciary," Kamal said.
Since his overthrow in February 2011, Mubarak has been on a roller coaster ride through the courts during which he has been convicted, only for another court to overturn the ruling, grant him a retrial and order him released. Still, he was kept behind bars pending his retrial and on other charges.
For his first trial, on charges of corruption and conspiracy in the deadly shooting of nearly 900 protesters during the uprising against him, he was on a gurney behind prison cage bars and denied the charges. The first Arab leader to face trial by his own people, Mubarak was convicted and sentenced to life in prison.
In January, a court overturned his life sentence on the grounds that the prosecution lacked concrete evidence and failed to prove the protesters were killed by the police. His trial on charges of alleged complicity in the killing of protesters resumes August 25.
Lawyer Ahmed Ragheb, who was part of a commission appointed by Morsi to find new evidence for the trial of Mubarak and associates, said the decision to release Mubarak was no surprise. He said the prosecution was poor and the evidence was collected by police who were largely loyal to Mubarak and his security chiefs.
"This goes to show that the main problem (of prosecuting Mubarak) is in the judiciary ... and the failure to institute a transitional justice process," he said. "The judiciary, including the prosecution, the police and the courts, go back to the Mubarak era."
Get Breaking news, live coverage, and Latest News from India and around the world on NDTV.com. Catch all the Live TV action on NDTV 24x7 and NDTV India. Like us on Facebook or follow us on Twitter and Instagram for latest news and live news updates.