Mubarak and his two sons sits in the defendants cage during retrial in Cairo on May 9, 2015. ( AFP/Getty Images)

On Saturday, former Egyptian President Hosni Mubarak, who ruled the country for 30 years until his ouster in 2011, was sentenced to a three-year prison term on charges of corruption. But a Cairo Court of Appeals ruled that Mubarak, 87, who is being detained in a military hospital, had served enough time already, and would be free to go home, reported CNN. His sons, Gamal and Alaa were also freed on the charges of embezzlement, which totaled nearly $18 million. Instead of continuing to remain in prison, Mubarak and his two sons were “slapped a multimillion-dollar fine on Mubarak and his sons to pay back the Egyptian government for embezzlement.”

This ruling is just the latest in a years-long legal saga for Mubarak, who was overthrown during the Arab Spring in February of 2011. In May 2014, Mubarak and his sons were sentenced to three years in prison for “diverting public funds earmarked to renovate presidential palaces and using the money to upgrade family properties,” reported Al-Jazeera. In November 2014, “after three years of investigation and the accumulation of 160,000 pages of evidence,” a court failed “to establish any link between Egypt’s former president, Hosni Mubarak or his closest henchmen, including seven top security chiefs, and the deaths, in numerous cases caught on camera, of hundreds of protesters gunned down, bludgeoned to death or run over by police cars during the 18-day uprising that led to Mr Mubarak’s overthrow in February 2011,” reported The Economist. As a result, Mubarak was cleared of all charges.

In January, a court overturned convictions of embezzlement against Mubarak and his sons, and ordered a retrial, “but the Court of Cassation found legal procedures were not followed properly,” reported BBC News.

Previous: What Mubarak’s Release Means For Egypt
Hosni Mubarak Convicted of Embezzlement