An Egyptian appeals court on Tuesday overturned a three-year prison sentence against ousted strongman Hosni Mubarak on corruption charges and ordered a retrial in the sole case pending against him.
Supporters of the 86-year-old former leader broke into cheers and chanted "Long Live Justice!" as the court announced its decision.
In November, another court had dropped murder charges against Mubarak over the deaths of protesters during the 2011 uprising that ended his three decades of autocratic rule.
A lower court had handed down the jail sentence against Mubarak in May last year after convicting him of embezzling money earmarked for the maintenance of presidential palaces.
It had also given four-year jail sentences to the toppled leader's sons, Alaa and Gamal. Four other defendants in the graft case were acquitted last year.
The Court of Cassation did not specify whether Mubarak was a free man following its judgement.
But defence lawyer Farid al-Deeb told AFP that his client ought to go free as he "has already served" three years in detention, including the time he spent in custody awaiting trial.
"But he will remain in hospital because he is not feeling well," Deeb said.
A legal expert said there was no reason Mubarak would remain detained.
"Legally he should be released because he has either served his time or nearly finished it, and according to the law he could be released after serving two-thirds of his time," said Gamal Eid, a legal expert at the Arabic Network for Human Rights Information.
"Holding him in custody will be illegal. They could release him without announcing it, but if he remains in custody, this could be due to the political pressure," he said.
Signup to our newsletter and follow us on Facebook and Twitter!
In 2011, there were mass protests demanding Mubarak's prosecution after he retired to a mansion in the Red Sea resort of Sharm al-Sheikh following the Arab Spring uprising that forced him from power.
He was detained two months later and ordered to stand trial.
The court ruled that prosecutors should not have added Mubarak's name to the list of defendants in the murder trial, after originally charging only his security chiefs.
The seven security commanders, including feared former interior minister Habib al-Adly, were all acquitted.
President Abdel Fattah al-Sisi ousted Mubarak's Islamist predecessor Mohamed Morsi in July 2013 and launched a deadly crackdown that has left more than 1,400 people dead.
Thousands more, mostly Islamist supporters of Morsi, have been imprisoned, and dozens sentenced to death after mass trials which the United Nations says is "unprecedented in recent history".
Human rights group say that Sisi has been even more autocratic than Mubarak.
The crackdown that initially targeted Morsi supporters has also jailed several leading youth leaders who campaigned against Mubarak during the 2011 revolt.
But the former army chief's promise of a strong hand has appealed to those many Egyptians weary of the years of political turmoil and economic decline since the uprising.
Several Mubarak-era officials have made a comeback as have the once reviled police.
Washington, meanwhile, has slowly warmed up again to its ally, after it initially lashed out at Sisi's crackdown on Morsi's supporters.
The United States delivered 10 Apache helicopters last month after lifting part of a freeze on aid as mounting turmoil across the region underlined Egypt's importance as an ally.
The United States annually allocates some $1.5 billion in aid to Egypt, including $1.3 billion in military assistance.
That was frozen in October 2013 pending the enactment of democratic reforms.