Cairo CNN  — 

Ousted Egyptian President Mohamed Morsy collapsed and died in a Cairo court Monday, soon after making a final statement in his trial on espionage charges.

Egypt’s first democratically elected leader, Morsy, 67, had just been led back to a soundproof glass cage inside the courtroom when he fell unconscious, Egypt’s public prosecution office said in a statement.

“He spoke 7 minutes just before the trial session adjourned,” Morsy’s lawyer Abdel Moneim Abdel Maqsoud told CNN. “A minute after, we saw fuss in the court glass box, we could hear the defendants screaming, Dr. Morsi has fallen,” said Abdel Maqsoud, who is also the lead lawyer for the banned Muslim Brotherhood movement.

Morsy had closed his final statement by quoting a verse of a poem that read, “My country is dear even if it oppressed me and my people are honorable even if they were unjust to me,” Abdel Maqsoud said.

Egypt’s state-run Al Ahram online reported that the former leader suffered a heart attack. He was pronounced dead after arriving at hospital at 4:50 p.m. (10:50 a.m. ET), the prosecutor’s office said. No apparent injuries were found on his body, it added.

On Monday evening, Turkey’s president, Recep Tayyip Erdogan, reacted to the news, calling Morsy a “brother” and a “martyr,” according to state-run news agency Anadolu.

Erdgoan also tweeted about Morsy’s death, saying he had “conducted one of the biggest democratic struggles of the history.”

Morsy was buried in Nasr City, a district in eastern Cairo, alongside other senior figures of the Muslim Brotherhood, his wife Naglaa Mahmoud said on her Facebook page on Tuesday.

Egyptian authorities barred Morsy’s relatives from burying his body in his home province of Sharqiya, Mahmoud said. Family members were allowed to attend the burial, she said.

According to Islamic law and Egyptian tradition, the deceased should be buried as soon as possible. Muslim burial rites are commonly performed the same day or within 24 hours of death.

A polarizing figure

A strict Islamist who was educated in southern California, Morsy was voted into power in June 2012 following the 2011 Arab Spring uprising that toppled Hosni Mubarak’s longstanding rule.

A senior member of the Muslim Brotherhood, Morsy had campaigned on appealing to the broadest possible audience.

But, during his year in power, critics say he became an authoritarian leader who forced through a conservative agenda.

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.

The Muslim Brotherhood is a religious and political group founded on the belief that Islam is not simply a religion, but a way of life. The group advocates moving away from secularism and returning to the rules of the Quran as a basis for healthy families, communities and states.

The Brotherhood has branches in 70 countries, but not all of the branches operate under the same identity. In Egypt, the group has been part of the political scene for more than 80 years.

The movement officially rejects the use of violent means to secure its goals. However, offshoots of the group have been linked to attacks in the past, and critics blame the Brotherhood for sparking troubles elsewhere in the Middle East.

In August 2013, roughly 1,000 Egyptians – many of them Morsy supporters – were killed during protests against the military government.

Supporters of ousted president Mohamed Morsy demonstrate in Cairo in November 2013.

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.

In 2015, he was sentenced to death over a jailbreak during the 2011 uprising and to life in prison on espionage charges after being convicted of conspiring with Palestinian group Hamas, the Iranian Revolutionary Guard and other foreign organizations.

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.

In 2016, Morsy’s death sentence and life sentence were overturned.