A judge has ruled that former Egyptian President Hosni Mubarak could be released from prison pending further investigation into corruption charges against him.

Mubarak was not immediately released after the Wednesday ruling, because he can be held for up to 48 hours pending a possible appeal.

But prosecutors said later that they would not appeal, so the ruling removes the final legal barrier preventing the 85-year-old former president from leaving prison. His lawyer, Farid al-Deeb, said that he expected his client to be released as early as Thursday.

Mubarak would likely return to his villa in the resort city of Sharm el-Sheikh, security sources said, ahead of further hearings. State television reported on Wednesday night that he would be placed under house arrest.

After the fall of Muslim Brotherhood rule, Mubarak’s defence will likely shift the blame to them. Hoda Nasrallah, Egyptian Initiative for Personal Rights

A free Mubarak would be seen by some Egyptians as another sign of the old regime reasserting itself, just weeks after Mohamed Morsi, Egypt’s first democratically-elected president, was toppled by the military. He would emerge from a prison which now houses numerous senior members of Morsi’s Muslim Brotherhood.

Mubarak has already spent more than two years in pre-trial detention, the maximum allowed under Egyptian law, and is now eligible for release pending trial.

The courts have issued three orders since April releasing Mubarak on various charges, and Wednesday’s ruling cleared the way for his release on the fourth and final one. He will still face trial on charges including complicity in killing of protesters during the 2011 revolution that toppled him and three separate corruption cases.

The bigger test for judicial independence, judicial experts say, will be the trials themselves, particularly the charge of killing protesters. With an army-backed interim government in power, many observers expect to see Mubarak eventually acquitted.

“After the fall of Muslim Brotherhood rule, Mubarak’s defence will likely shift the blame to them,” said Hoda Nasrallah, a lawyer at the Egyptian Initiative for Personal Rights, referring to claims by Mubarak’s longtime intelligence chief Omar Suleiman that the Brotherhood was responsible for the violence during the revolution.

“[And] as for the financial corruption cases, often these cases are settled when the amount in question is returned,” she told Al Jazeera

Corruption and murder

At least one of those cases could indeed be close to a settlement. Wednesday’s ruling concerns the so-called “Ahram gifts” case, in which Mubarak allegedly accepted $11m worth of gifts, including jewelry and watches, from the state-run newspaper Al-Ahram.

He has allegedly already repaid the amount of the gifts, and the other defendants in the case have been released, suggesting that the charges against Mubarak could eventually be dropped.

He also faces charges of embezzling money from a fund earmarked for presidential palace renovations. A judge working on this case ordered him released on Monday, on the same procedural grounds. A separate charge accuses him of “illicit gains” during his presidency.

Mubarak was convicted last year of involvement in the murder of protesters during the 2011 uprising, and sentenced to life in prison, but was granted a retrial earlier this year. His next hearing is scheduled for August 25.

Both the prosecution and defence subsequently filed appeals. The latter claimed that the case against Mubarak was weak, something even the presiding judge, Ahmed Refaat, acknowledged in his verdict.

He admitted that prosecutors did not present compelling evidence that Mubarak directly ordered the killings. Instead, Refaat faulted the former president for failing to stop the killings, convicting him through a kind of guilt-by-association.

Morsi ordered a fact-finding committee to investigate the violence since the start of the revolution. The report has not been made public, but leaked details suggest that it implicates Mubarak and his top aides, including interior minister Habib al-Adly, who is on trial alongside Mubarak.

But many in Egypt doubt that the full report will ever be released, because it could implicate many senior military and security officials.

Many of Mubarak's ministers and top aides have been acquitted in trials following the revolution. Activists blame the judiciary, much of which was appointed during Mubarak’s 30-year rule, while judges argue they have been overwhelmed by the workload and often handed cases that lack solid evidence.

“There have been many scepticisms about the independence of judiciary,” said Youssef Auf, a judge. “We need independent separate courts and investigators to work on all the grievances that have been seen in Egypt over the past 33 years.”