Egypt's first democratically elected president, Islamist leader Mohammed Morsi, has been buried under heavy security, a day after his dramatic collapse and death inside a glass cage of a Cairo courtroom.
Morsi's family attended funeral prayers in the mosque of Cairo's Tora prison, followed by the burial at a cemetery in the city's Nasr City district, according to Abdul-Moneim Abdel-Maqsoud, a member of Morsi's defence team.
Morsi's son, Ahmed, said security agencies refused to allow Morsi to be buried at the family's cemetery in his hometown in Sharqia province.
Morsi, 67, hailed from Egypt's largest Islamist group, the now outlawed Muslim Brotherhood, and was elected president in 2012 in the country's first free elections following the 2011 ouster of longtime leader Hosni Mubarak.
But he alienated millions by imposing the Brotherhood's conservative brand of Islam and was accused of economic mismanagement.
The military toppled Morsi in 2013 after massive protests and crushed the Brotherhood in a major crackdown, arresting Morsi and other leaders.
During his years in prison, Morsi, who was known to have diabetes, was often held in solitary confinement and was largely barred from receiving visitors. His family was only allowed to visit three times.
Morsi had been in court for a hearing on charges of espionage emanating from alleged contacts with the Palestinian Islamist group Hamas.
He was serving a 20-year prison sentence for a conviction arising from the killing of protesters during demonstrations in 2012, and a life sentence for espionage in a case related to Qatar. He had denied the charges.
Morsi's Muslim Brotherhood on Monday accused the government of "assassinating" him through years of poor prison conditions and demanded an international investigation into Morsi's death.
Late Monday, Egypt's chief prosecutor said Morsi's body would be examined to determine the cause of his death, but a heart attack is expected.
Morsi collapsed Monday after addressing the court, speaking from the glass cage he was kept in during sessions and warning that he had "many secrets" he could reveal, a judicial official said.
In his final comments, he continued to insist he was Egypt's legitimate president, demanding a special tribunal.
Amnesty International called for an "impartial, thorough and transparent" investigation into Morsi's death.