Egypt's former President Mohammed Morsi breathed his last on Monday after fainting in a courtroom during a trial session, state media reported.
The 67-year-old was at the session over accusations of espionage, according to BBC.
"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 was quoted as saying.
Morsi became Egypt's first democratically elected president in 2012 after the 2011 Arab Spring saw the end of former President Hosni Mubarak's 30-year rule. He was then deposed following mass protests and a military coup in July 2013.
The ousted leader had remained in custody since then, while the movement to which he belonged, the Muslim Brotherhood, has since been outlawed, Al Jazeera reported.
The Cairo Criminal Court had adjourned the trial of Morsi and 23 others in the case of "collaborating with Hamas" for tomorrow.
In November 2016, the Court of Cassation scrapped the life imprisonment sentence for Morsi and 21 other defendants, including some who had received the death penalty, in the same case, and ordered a retrial.