A human rights group has called for an investigation after Egypt's first democratically-elected president, Mohamed Morsi, who was ousted by the military in 2013, died in court while on trial.

The 67-year-old Islamist had just addressed the court on Monday, warning that he had "many secrets" he could reveal, a judicial official told the Associated Press.

A few minutes later, he collapsed and died in a glass defendants’ cage. He was known to suffer from diabetes and high blood pressure.

His death is likely to pile pressure on the Egyptian government over its human rights record, especially conditions in prisons where thousands of Islamists and secular activists are held.

Morsi was buried in Cairo in the presence of some family members, one of his lawyers said early Tuesday.

In his final comments, he continued to insist he was Egypt's legitimate president.

'Premeditated murder'

Morsi's Muslim Brotherhood accused the government of "assassinating" him through years of poor prison conditions. In a statement, the group demanded an international investigation into Morsi's death and called for protests outside Egyptian embassies across the world.

It was a dramatic end for a figure who was central in the twists and turns taken by Egypt since its "revolution" — from the pro-democracy uprising that in 2011 ousted the country's longtime authoritarian leader, Hosni Mubarak, through controversial Islamist rule and now back to a tight grip under the domination of military men.

Morsi was quietly buried in Cairo overnight, lawyers said REUTERS

Critics accused the Brotherhood of using violence against opponents and seeking to monopolize power and Islamize the state. Massive protests grew against their rule, until the military — led by then-Defense Minister, Abdel-Fattah el-Sissi — ousted Morsi in July 2013, dissolved parliament and eventually banned the Brotherhood as a "terrorist group."

El-Sissi was elected president and re-elected in 2018 in votes sharply criticized as undemocratic. He has waged a ferocious crackdown that crushed the Brotherhood but also almost all other dissent, arresting tens of thousands, banning protests and silencing most criticism in the media.

Sarah Leah Whitson, Middle East director with the Human Rights Watch, said in a tweet that Morsi's death was "terrible but entirely predictable" given the government "failure to allow him adequate medical care, much less family visits."

Mohammed Sudan, leading member of the Muslim Brotherhood in London, said Morsi was banned from receiving medicine or visits and there was little information about his health condition.

"This is premeditated murder. This is slow death," he said.

'History will never forget'

Freedom and Justice, the Brotherhood's political arm, said in a statement on its Facebook page that prison conditions led to Morsi's death in what amounted to "assassination."

In audio leaked from a 2017 session of one of his trials, Morsi complained that he was "completely isolated" from the court, unable to see or hear his defense team, his eyes pained by lighting inside the cage.

Magdalena Mughrabi, deputy director for the Middle East at Amnesty International, said Morsi's death "raises serious questions about his treatment in custody."

She called for Egyptian authorities to order "an impartial, thorough and transparent investigation into the circumstances of his death, as well as his detention conditions and his ability to access medical care."

Hamas praised Morsi for his stance toward the Gaza Strip, and his "unforgettable and brave positions and his work to lift its siege” during his rule.

Turkey’s President Tayyip Erdogan said Mori was “a martyr who lost his life while he fought for the cause he believed in.”

“History will never forget the tyrants who put him in prison, threatened him with death penalty and caused his martyrdom,” he said.

Want more news?