Hosni Mubarak, the Egyptian president overthrown in 2011 and the first leader to face trial after the Arab Spring uprisings that swept the region, walked free on Friday for the first time in six years, his lawyer said.
He left the Maadi Military Hospital where he had been detained, heading to his home in Heliopolis.
The 88-year-old was cleared of the final murder charges against him this month, after facing trial in a litany of cases ranging from corruption to the killing of protesters whose 18-day revolt ended his 30-year rule.
Meanwhile, an Egyptian court on Thursday ordered a renewed corruption probe into the ousted president.
The new investigation centres around allegations that he, his wife, two sons and their wives received gifts valued at about $1 million from the state-owned Al-Ahram newspaper.
An investigative judge had agreed in 2013 to drop the probe after they paid back the amount, but the prosecution appealed.