Hosni Mubarak
The former president spent six years in detention at a Cairo military hospital Amr Abdallah Dalsh/Reuters

The former Egyptian President Hosni Mubarak has been freed from detention, six years after being overthrown.

Mubarak left a military hospital in southern Cairo and went to his home in the affluent northern suburb of the capital called Heliopolis, his lawyer said.

He was ordered to be freed earlier this month after Egypt's top appeals court cleared him over the deaths of protesters in the 2011 uprising.

Mubarak's democratically elected successor, Mohamed Morsi, was overthrown in a popularly backed military coup in 2013. Many see echoes of Mubarak's style of leadership in Egypt's current leader, the former general Abdel Fattah el-Sisi.

Mubarak, 88, became president in 1981 after Anwar Sadat's assassination.

In all, more than 800 people are believed to have been killed as security forces clashed with protesters in Cairo, Alexandria, Suez and other cities around Egypt during the 18-day uprising that forced Mubarak to resign.

His release came at around the same time that at least one person was killed and three more were injured after an explosion in the suburb of Maadi in Cairo.

Security services said that the cause of the blast was not immediately known. No claim of responsibility has been made.