Former President Mohamed Morsi of Egypt died after appearing in court in Cairo on Monday, according to state media.
The 67-year-old first democratically elected president died after fainting during the court session in Cairo, the Egyptian capital.
The public prosecutor said he collapsed in a defendants’ cage in the courtroom and was pronounced dead in hospital at 4.50 p.m. local time (02:50 GMT) on Monday.
A medical report showed no apparent recent injuries on his body, the prosecutor said.
“Morsi died today while attending a session in his trial on espionage charges. During the session, he was granted permission to address the judge,” a presenter with Egypt’s state TV said.
“After the session was adjourned, the former president blacked out and then died. His body was taken to a hospital.”
Morsi had a history of health issues, including diabetes and liver and kidney disease.
He had suffered from medical neglect during his imprisonment, compounded by the poor conditions in jail.
He was then deposed following mass protests and a military coup in July 2013 and was immediately arrested.
Morsi served just one of a four-year term, while the organisation, to which he belonged, the Muslim Brotherhood, has since been outlawed.
Morsi, who was facing at least six trials, had been behind bars for nearly six years and was serving a 20-year prison sentence for a conviction arising from the killing of protesters during demonstrations in 2012.
He was also serving a life sentence for espionage in a case related to the Gulf state of Qatar.
Other charges against the former leader include jailbreak, insulting the judiciary and involvement in “terrorism”.
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.
Turkish President Recep Tayyip Erdogan was the first world leader to pay tribute to Morsi, calling him a “martyr.”
“May Allah rest our brother Morsi, our martyr’s soul in peace,” said Erdogan, who had forged close ties with the late former president.