By Nehal El-Sherif and Walid Zaki,
Cairo -
By Nehal El-Sherif and Walid Zaki, - Mohammed Morsi, who became Egypt's first democratically elected leader in 2012 before being deposed in a military coup the following year, died on Monday after he collapsed during a court session in Cairo.
One of his sons, Ahmed, confirmed Morsi's death.
"My father, we will meet again with God," he wrote in a Facebook post.
Morsi was allowed by the judge to address the court as per his request.
The former president spoke for five minutes before he fell unconscious and died on the way to the hospital, the country's top prosecutor said in a statement.
Morsi took office in mid-2012, around a year after an uprising ousted his predecessor Hosny Mubarak.
His death comes almost six years after he was ousted by the military on July 3, 2013, following mass protests against his one year in power.
"There were no apparent recent injuries to the body of the deceased," the prosecutor's statement added.
The prosecutor ordered the confiscation of surveillance cameras in the court and the questioning of those present with Morsi at the time.
Morsi, a member of the now-banned Muslim Brotherhood group, had faced several trials since his ouster.
Monday's session was part of a trial in which he was facing treason charges for allegedly leaking secret state documents to Qatar while he was in office.
The Ministry of Interior declared a state of maximum alert in the country after the announcement.
The Muslim Brotherhood was formed in 1928 but was only able to form a political party, the Freedom and Justice party, in 2011. It was headed by Morsi.
The Brotherhood said Egyptian authorities had wanted a "slow death" for Morsi.
"They put him in solitary confinement for more than five years, restricted medicine and gave him bad food. They banned doctors and lawyers from communicating with him and even his family," the party said in a statement.
"They prevented him from his most basic human rights. The goal was to kill him slowly," it added.
Sarah Leah Whitson, Human Rights Watch's Middle East director, described Morsi's death as "terrible but entirely predictable" and criticized in a tweet the Egyptian government's "failure to allow him adequate medical care, much less family visits."
In 2017, HRW said in a report that Morsi's conditions in prison "may have contributed to a decline in his health."
Amnesty International said Morsi's death raises "serious questions about his treatment in custody" and called for a thorough investigation.
"We received with great sorrow the news of the sudden death of former president Mohamed Morsi," Qatari leader Emir Tamim bin Hamad Al Thani said.
Turkish President Recep Tayyip Erdogan also offered his condolences, describing Morsi as "my brother" and a "martyr."
Erdogan praised the Islamist leader, writing in a tweet that Morsi had fought "one of the greatest democratic struggles in history."
Egypt's relations with Qatar and Turkey have strained since Morsi's ouster, as Cairo accuses both countries of supporting the Muslim Brotherhood, which was banned by a court shortly after Morsi was deposed.
Jordan's branch of the Muslim Brotherhood blamed Egyptian authorities for Morsi's death as well as the international community for "its silence and its acceptance of the coup's crimes."
Islamists describe Morsi's ouster as a coup, while his opponents praise the army for protecting the Egyptian people.
Tunisia's Islamist Ennahda party, which was inspired by Egypt's Muslim Brotherhood, offered its condolences and said it hoped "this painful incident" would lead to a political dialogue and the release of political prisoners.
Over the past six years, Egypt has launched a crackdown that has seen thousands of people behind bars, mostly accused of involvement in deadly violence or being members of the Brotherhood.
Following Morsi's ouster, extremist attacks intensified in Egypt, mostly targeting security forces in northern Sinai as well as Christians in the country.
Authorities accuse Muslim Brotherhood members and sympathizers of being affiliated with the jihadists.