Egyptian state television said former president Mohammed Morsi, who was removed from office by the army in 2013, died shortly after appearing in court on Monday, according to Al Jazeera.
Morsi, 67, fainted after a court session where he was facing espionage charges.
The former president who was overthrown after mass protests died shortly after fainting.
"He was speaking before the judge for 20 minutes then became very animated and fainted. He was quickly rushed to the hospital where he later died," a judicial source said to Al Jazeera.
Morsi was democratically elected in 2012 after the 2011 Arab Spring ended Egyptian President Hosni Mubarak's 30-year-rule.
But he served only one year of a four-year term after he was deposed and removed during a military coup in July 2013.
Morsi's political organization, the Muslim Brotherhood, has since been outlawed in Egypt.
His family told Anadolu news agency in March Morsi's health had deteriorated severely in recent months.