CAIRO -- Egypt’s ousted president Hosni Mubarak was ordered to be freed from detention on Monday, according to the prosecutor who signed his release order - ending nearly six years of legal proceedings against the long-ruling autocrat.

The prosecutor, Ibrahim Saleh, told The Associated Press that he ordered Mubarak’s release after he accepted a petition by the former president’s lawyer for his freedom on the basis of time already served.

Mubarak, 88, was acquitted by the country’s top appeals court on March 2 of charges that he ordered the killing of protesters during the 2011 uprising that ended his 29-year rule. That verdict, according to Saleh, cleared the way for the lawyer to request that his client be released since he has already served a three-year sentence for embezzling state funds while in detention in connection to the protesters’ case.

“There is not a single reason to keep him in detention and the police must execute the order,” Saleh said. “He is free to go.”

Get Breaking News Delivered to Your Inbox

A criminal court ruled in May 2015 to imprison Mubarak for three years following his conviction of embezzling funds set aside for the maintenance of presidential palaces.

Mubarak was first detained in April 2011, but has spent the nearly six years since in hospitals. He is currently staying at a Nile-side military hospital in the leafy suburb of Maadi, just south of Cairo.

It was not immediately clear when he would actually leave and go home in the eastern suburb of Heliopolis.