There are no legal grounds to keep deposed Egyptian president Hosni Mubarak in detention after an appeals court ordered his retrial in a corruption case, according to a judicial official.
The official at the chief prosecutor's office said Mubarak has the right to walk free after Egypt's top appeal court ordered a retrial in a corruption case against him and his two sons.
It was the only case still keeping Mubarak behind bars. He has already been cleared over the killings of protesters during Egypt's 2011 uprising that toppled him.
The official said "paperwork is being processed" for Mubarak's release but declined to speculate when that could happen.
The ruling by the Appeals Court in Cairo overturned an earlier verdict which had sentenced Mubarak to three years in prison and his sons Alaa and Gamal to four years each, while four other defendants in the case were acquitted. Mubarak's lawyers appealed against that verdict.
Though the ruling paved the way for Mubarak's imminent release, there was no explicit statement from the authorities that he would leave the hospital in Cairo where he was being held.
There were also conflicting remarks over whether the release would take place. An unnamed security official told the state-run news agency MENA that Mubarak would remain in detention because the Appeals Court ruling did not include a release order.
In the case of the killings of protesters, a judge ruled that the charges were "inadmissible" on a technicality. But the same judge also described the uprising - one of the first that swept the region in what later became known as the Arab Spring - as part of an all alleged "American-Hebrew conspiracy" to undermine Arab countries for Israel's benefit.
That ruling was a blow to the pro-democracy groups and youth groups that spearheaded the "revolution" against Mubarak.
The corruption case - dubbed by Egyptian media as the "presidential palaces" affair - is linked to charges that the three Mubaraks embezzled millions of pounds of state funds over a decade toward the end of Mubarak's rule.
The funds were meant for renovating and maintaining presidential palaces but were instead spent on upgrading the family's private residences.
Mubarak and his sons were fined 21.1 million Egyptian pounds (£2 million) and ordered to reimburse 125 million Egyptian pounds (£11.6 million) to the state treasury.
The Mubaraks had returned around 120 million Egyptian pounds (£11.1 million) to the state in connection with this case in the hope that the charges would be dropped, but the proceedings against them continued.