Morsi, 67, requested to speak during the session before he fainted and died.
Al-Watan newspaper cited judicial sources as saying that Morsi spoke for 25 minutes “then stopped and felt exhausted before fainting in the (court’s) cage.”
Abdel-Monem Abdel-Maqsoud, a lawyer for the former president, said the defence team received news of his death from other defendants who were with him during the session.
“President Morsi was moved from the court and we didn’t know his place as we were following the procedures after the demise,” he said.
Abdel-Maqsoud added to Anadolu Agency that Morsi said during his last trial that he would remain proud of his country despite “the injustice he suffered,” after the coup.
“I know secrets that I won’t reveal for the sake of my country’s security,” Morsi was quoted by his lawyer as saying.
The lawyer went on to note that Morsi was also criticising the way he was treated in prison.
Egypt’s public prosecutor Nabil Sadek said in a statement that Morsi arrived dead to the hospital and there were no marks of injuries on his body.
“While defendant Mohamed Morsi was present in the cage with other defendants he fainted and fell on the ground and was immediately moved to the hospital where his demise was confirmed,” said Sadek.
The body of the late president has been transferred to a nearby hospital, Egyptian newspaper Al-Youm Al-Sabe reported.
Morsi faced a host of charges since he was ousted and imprisoned in the 2013 military coup, which was led by the current President Abdel-Fattah al-Sisi.
There were six charges against the former leader including, “jailbreak, murder, spying for Qatar, spying for Hamas and Hezbollah, insulting the judiciary and involvement in terrorism.”