Morsy, 67, had been on trial for an espionage case when he suffered a heart attack, Egypt’s state-run Al Ahram online reported.
He had been granted a request to make a statement before he fainted and passed away, state media said. The former president has been taken to an unnamed hospital, it added.
A former member of the Muslim Brotherhood, Morsy had campaigned on appealing to the broadest possible audience.
In 2013, Morsy and the political wing of the Muslim Brotherhood movement were ousted in a coup, with the Muslim Brotherhood banned by the government after the military seized power and declared it a terrorist organization.
Roughly 1,000 Egyptians — many of them Morsy supporters — were killed during protests against the military government.
Following his ouster, Morsy was tried en masse with Mohamed Badie — the spiritual leader of the Muslim Brotherhood — as well as more than 100 alleged members of the outlawed group, according to state media.
Both of those sentences were widely criticized as political grandstanding.
Morsy was also handed a 25-year prison sentence for leaking state secrets to Qatar, and had received an additional 15-year sentence for other, lesser, charges.
CNN’s Vasco Cotovio contributed to this report.