Ousted Egyptian president Mohammed Morsi has been quietly buried under heavy security in Cairo after his collapse and death in court, a lawyer said.
Mr Morsi's family attended funeral prayers in the mosque of Cairo's Tora prison before the burial at a cemetery in the city's western district of Nasr City, said Abdul-Moneim Abdel-Maqsoud, a member of his defence team.
Security agencies refused to allow Mr Morsi to be buried at the family's cemetery in his hometown in Sharqia province, his son Ahmed said.
The 67-year-old, who was on trial for espionage charges, had addressed the room just minutes before fainting.
Speaking from the glass defendants cage, he told the court of the "many secrets" he harboured and could reveal.
State television later quoted an unnamed medical source as saying he had suffered a heart attack.
The hearing at the courthouse in Cairo's Tura Prison on Monday was part of a re-trial for espionage charges relating to the Palestinian Hamas militant group.
A lawyer representing Mr Morsi said his client was "calm and organised" ahead of the hearing.
He said: "He summarised our argument in three to five minutes. He insisted on a special tribunal as he is the president of the republic."
A statement from Egypt's attorney general said surveillance cameras inside the court would be reviewed, and a post-mortem would be carried out.
Mr Morsi gained prominence as the leader of the now-banned Muslim Brotherhood group, before becoming Egypt's first democratically elected president in July 2012.
He was ousted just a year later in a military coup led by Abdel Fattah Al-Sisi, who is Egypt's current president, following weeks of huge anti-government protests across the North African nation.
The well-being of the former president, who has been detained since the coup, has repeatedly featured in the headlines.
His son Ahmed has previously spoken to media about the "severe deterioration" of his father's health in prison, and said authorities had "ignored" his needs.
Mohammed Sudan, a member of the London branch of the Muslim Brotherhood group, said Mr Morsi's death amounted to "premeditated murder".
He said: "He has been placed behind glass cage [during trials].
"No one can hear him or know what is happening to him. He hasn't received any visits for a months or nearly a year. He complained before that he doesn't get his medicine. This is premeditated murder. This is slow death."
Meanwhile, Human Rights Watch said the incident was "predictable" given authorities' "failure" to provide necessary care.
The organisation pointed to a report that it had written two years earlier, which described the "cruel and inhumane" treatment Mr Morsi had received in detention.
It detailed "appalling conditions" that led to him losing weight, fainting, and experiencing a diabetic coma.
In a tweet on Monday, Amnesty International called for an investigation surrounding Mr Morsi's sudden death, and the conditions he had faced in prison.
It said: "We call on Egyptian authorities to conduct an impartial, thorough and transparent investigation into the circumstances of Morsi's death, including his solitary confinement and isolation from the outside world."
As news broke of the death, condolence messages from Mr Morsi's allies around the Arab world were quickly published.
Turkish President Recep Tayyip Erdogan said Mr Morsi was a "brother" and a "martyr", and sent his best wishes to the Muslim Brotherhood and the Egyptian population.
Qatar's Emir, Sheikh Tamim bin Hamad al-Thani, also tweeted his condolences to Mr Morsi's family and "brotherly Egyptian people".
In a statement, Hamas praised the Egyptian as an "unforgettable and brave" leader, and referred to Mr Morsi's role in easing restrictions placed on the Gaza Strip, which were initially put in place after the militant group took control in 2007.
BDST: 1500 HRS, JUN 18, 2019