Egypt's former President Mohammed Morsi, who was ousted by the military in 2013, has died after fainting in a courtroom, officials say.
A top figure in the now-banned Islamist movement Muslim Brotherhood, Morsi collapsed in a cage after speaking at a hearing on charges of espionage.Morsi, who was 67, had been in custody since being overthrown following mass protests a year after he took office.
Activists and his family had long complained about his prison conditions.
There were concerns about Morsi not receiving medical treatment for serious health problems such as high blood pressure and diabetes, and that he was being held under constant solitary confinement.
What happened in court?
Morsi collapsed moments after addressing the court in Cairo from a cage some defendants are kept in during sessions, Egypt's public prosecutor said, adding that a medical report showed no signs of recent injuries on the body.
The hearing related to charges of espionage emanating from suspected contacts with the Palestinian Islamist group Hamas, which had close ties to the Muslim Brotherhood.Morsi, who became Egypt's first democratically elected leader after winning polls in 2012, had already been sentenced to more than 45 years in prison in three separate trials, including leading an outlawed group, detention and torture of anti-government protesters and leaking state secrets.
Last month, his family said authorities had repeatedly denied access to him and they knew little about his health conditions, a situation that "violate[d] constitutions applied all over the world".
In March last year, his youngest son, Abdullah, said in a Washington Post op-ed that the authorities were "doing this on purpose, since they want to see him dead 'from natural causes' as soon as possible".
A death certain to inflame passions
The death of a leader, remembered by many as Egypt's first democratically elected president, is certain to inflame passions among his supporters and allies in Egypt and beyond. Turkey's President Recep Tayyip Erdogan has been quick to describe him as a martyr. Others are certain to do the same.
There has long been concern about the politicised trials which have kept him in prison, as well as his conditions of confinement. Morsi had a history of ill-health.
But last year, a British parliamentary panel reported he was being kept in solitary confinement for 23 hours a day, which they concluded could be classified as torture. They warned this could lead to premature death.
His sudden collapse comes at a time when the United States, reportedly at the request of Egyptian President Abdel Fattah al-Sisi, is working to designate the Muslim Brotherhood as a foreign terrorist organisation. The death of one its most senior figures will deepen the anger and anxiety in this global Islamist movement.
What has the reaction been?
Mohamed Soudan, a spokesman for the Muslim Brotherhood in the UK said the death was "first degree murder" and that Morsi had had only three or four family visits during his time in custody, rather than regular weekly visits which are usually granted for prisoners.
President Recep Tayyip Erdogan, who was a close ally, said Morsi had become a "martyr" and he blamed Egypt's "tyrants".
Crispin Blunt MP, who led a panel of British MPs and lawyers who had warned about Morsi's health conditions, called for a "reputable independent international investigation", and said Egypt's government had a "duty to explain his unfortunate death".
Morsi was born in the village of El-Adwah in the Nile Delta province of Sharqiya in 1951. He studied Engineering at Cairo University in the 1970s before moving to the US to complete a PhD.
He was chosen as the Muslim Brotherhood's presidential candidate for the 2012 election after the movement's preferred choice was forced to pull out. During his turbulent year in office, Morsi was accused of allowing Islamists to monopolise the political scene and mishandling the economy.
Public opposition to his government grew and millions of anti-government protesters took to the streets across Egypt to mark the first anniversary of the day he took office, on 30 June 2013.
On 3 July, the army suspended the constitution, announced an interim government ahead of new elections and detained Morsi, who denounced the move as a coup. Abdul Fattah al-Sisi, then army chief, was elected president in 2014.
Authorities then launched a crackdown on his and Muslim Brotherhood supporters, hundreds of people have been killed and thousands others detained as a result.
Meanwhile, Morsi supporters denounced his trials as politically motivated and attempts to give legal cover to a coup based on unreliable witnesses and scant evidence.