A lawyer said Mr. Mubarak may leave the courtroom as early as Thursday.
An Egyptian court has ordered the release of the deposed president, Hosni Mubarak, on charges of corruption, jolting a nation already in turmoil since the overthrow of Islamist President, Mohamed Morsi.
Mr. Mubarak will leave jail as early as Thursday, although the prosecution may still appeal.
The 85-year-old, who ruled Egypt for 30 years, is also being retried on charges of complicity in the killing of protesters during the 2011 uprising that removed him from power.
In the first trial, he was sentenced to life in jail last year, but a retrial was later ordered after his appeal was upheld.
That retrial opened in May but Mr. Mubarak, who was held in a jail on the suburbs of Cairo, has now served the maximum amount of pre-trial detention permitted in the case.
The court in Cairo on Wednesday upheld a petition from Mr. Mubarak’s lawyer demanding his release.
Reuters news agency quoted judicial and security sources as saying that the court had ordered his release. His lawyer, Fareed al-Deeb, confirmed this as he left Tora prison after the session. Asked when Mubarak would go free, he told Reuters: “Maybe tomorrow,” according to Reuters.
Reports say many Egyptians will see his release as an indication the army was speedily taking back control of the country, as already highlighted by the events of the past weeks since Mr. Morsi was removed.
More than 1,000 people have been killed in clashes between the army and supporters of Mr. Morsi who asked for his reinstatement.
The court ruling removed the last legal ground for Mr. Morsi’s imprisonment in connection with a corruption case, following a similar decision in another corruption case on Monday.
Mr. Mubarak’s trial, when he appeared in a courtroom cage, and his jailing also affronted some Egyptian officers, Reuters reported. One colonel, who asked not to be named, said the treatment of the former supreme military commander had “tarnished the army’s image”.