A onetime President of Egypt, Mohammed Morsi on Monday died during a court hearing, according to state television. The democratically elected Islamist held power for just one year before being ousted by the military in 2013.

Egyptian history shows that the 67-year-old was the country’s first democratically elected president and a member of Egypt’s most powerful Islamist group, the now banned Muslim Brotherhood.

The former president was on trial for espionage and treason when he blacked out in the courtroom, reports said. He was then taken to a Cairo hospital but could not be revived.

“He was speaking before the judge for 20 minutes then became very animated and fainted,” a judicial source told Agence France-Presse.

The Islamist was democratically elected in 2012, one year after the popular uprising that ended the rule of longtime leader Hosni Mubarak.

He was toppled by the army in July 2013 following mass protests against his government, after spending just one year in office.

The current President Abdel-Fattah el-Sissi, who was his defense minister and army chief, took power and cemented his rule in subsequent elections. Morsi and many other members of the Brotherhood were arrested in the crackdown that followed.

The ex-president since then has faced charges that include spying for Iran and Qatar, and plotting terror attacks. Monday’s session was part of a retrial over allegations of espionage with Palestinian militant group Hamas.

Turkish President Recep Tayyip Erdogan, who was a Morsi ally, paid tribute to the former leader: “May Allah rest our Morsi brother, our martyr’s soul in peace,” he said.

Mohammed Sudan, a leading member of the Muslim Brotherhood in London, called Morsi’s death a “premeditated murder,” saying the ex-president had been deprived of medical treatment.

“He has been placed behind glass cage (during trials). No one can hear him or know what is happening to him,” Sudan said. “He hasn’t received any visits for monthsHe complained before that he doesn’t get his medicine. This is premeditated murder. This is slow death.”