CAIRO - Opposition politician Abul-Ela Mady was released Wednesday after nearly two years of pretrial detention, Mady's son Ahmed said, two days after a court ordered him set free.

Mady was a supporter of ousted President Mohamed Morsi, who was removed from power by the army following mass protests against his rule in 2013.

Egypt Frees Pro-Morsi Politician After 2 Years of Pretrial Detention

Mady was detained on charges related to violence during protests between supporters and opponents of Morsi and his Muslim Brotherhood in July 2013.

Egypt Frees Pro-Morsi Politician After 2 Years of Pretrial Detention

The leader of the Muslim Brotherhood, Mohamed Badie, his deputy, Khairat el-Shater, and other Brotherhood leaders are also defendants in the case, judicial sources said.

Egypt Frees Pro-Morsi Politician After 2 Years of Pretrial Detention

Mady's release does not mean the case against him has been closed, Ahmed Mady, who is a lawyer, told Reuters.

Egyptian law limits pretrial detention to two years, and a court on Monday ordered that he be released.

Mady, 57, was a member of the Muslim Brotherhood until leaving in the 1990s, hoping to establish a more liberal-leaning Islamist party.

He founded the Wasat, or Center, Party after the 2011 popular uprising that unseated longtime autocrat Hosni Mubarak, who had prevented the formation of the party.