CAIRO, Egypt – Egypt’s first democratically elected president Mohamed Morsi, an Islamist who was ousted after one year of divisive rule, died after falling ill during a court hearing on Monday, the attorney general said.

He was 67.

Morsi, also the country’s first civilian president, had been “animated” during a hearing in the retrial of an espionage case in which he was accused of collaborating with adverse foreign powers and militant groups, judicial and security sources said.

“The court granted him his request to speak for five minutes. He fell to the ground in the cage and was transported immediately to the hospital. A medical report found no pulse or breathing,” said the attorney general’s office.

“He arrived at the hospital dead at 4:50PM exactly and there were no new, visible injuries found on the body.”

One of Morsi’s legal defence team described the moment he received news of his death.

“We heard the banging on the glass cage from the rest of the other inmates and them screaming loudly that Morsi had died,” the lawyer, Osama El Helw, told AFP.

Morsi, who hailed from Egypt’s largest Islamist group, the now outlawed Muslim Brotherhood, was elected president in 2012 in the country’s first free elections following the ouster the year before of longtime leader Hosni Mubarak.

His turbulent rule was marked by deep divisions in Egyptian society, a crippling economic crisis and often-deadly opposition protests.

Since Morsi’s overthrow on July 3, 2013, his former defence minister now President Abdel Fattah al-Sisi has waged an ongoing crackdown, targeting his supporters from the Muslim Brotherhood with thousands jailed and hundreds facing death sentences.