(CNN) Mohamed Morsy was in court when he died, in a glass cage that had almost become a second home during multiple trials. Egypt's first democratically-elected leader had spent one year as President and six years in prison.
Morsy was the most prominent of tens of thousands of Muslim Brotherhood members and supporters rounded up after a popularly supported coup in 2013 ended Egypt's brief flirtation with democracy.
By some estimates, Egypt has detained some 60,000 political prisoners, the great majority of them members and supporters of the Brotherhood. Human Rights Watch (HRW) reported that in a three-year period, at least 15,500 civilians were sent before military courts, including over 150 children. Human rights groups have documented dozens of cases of torture. Egypt has denied holding political prisoners and allegations of torture, and criticized HRW as a "dubious organization that promotes lies."
The 2013 coup was led by the man who now rules Egypt, Abdel Fattah el-Sisi. His government kept Morsy in jail from the moment he was overthrown, and he was often in solitary confinement for 23 hours a day.
Morsy's son Abdullah told CNN Monday that, "He was denied visits. The family was able to see him only three times since 2013."
Human rights groups warned that his poor health (he had diabetes as well as liver and kidney ailments) would lead to his premature death. Last year, a group of visiting British parliamentarians said his "inadequate care" would likely cause a "rapid deterioration of his long-term conditions, which is likely to lead to premature death."
Morsy's death, within minutes of telling the court that he had "many secrets" that he was not revealing to protect Egypt's national security, is symbolic of what has happened in Egypt and the broader Middle East in the seven years since the brief euphoria of the Arab Spring.
His election represented the zenith of that popular outburst, in a region where autocrats lasted decades. But it also pitted two uncompromising forces -- the Islamists and the security forces -- against each other.
Democracy was quickly suffocated in a year of deepening chaos.
As the candidate of the Muslim Brotherhood's Freedom and Justice Party, Morsy won 51.7% of the vote in the elections that followed President Hosni Mubarak's ousting. His victory was an earthquake in the Arab World, where the Brotherhood had been an underground movement for decades - both feared and repressed by autocratic leaders.
Historian Fawaz Gerges wrote in his "Making the Arab World" that with Morsy's election "in one stroke the Islamist organization went from being proscribed to being in charge."
Morsy's victory was lauded by Islamists and sympathizers of the Brotherhood, especially in Qatar and Turkey. But the conservative Gulf states -- Saudi Arabia and the United Arab Emirates especially -- saw him as a threat. King Abdullah of Saudi Arabia repeatedly warned Qatar against supporting the Muslim Brotherhood across the Arab world -- both before and after Morsy's election.
That schism, given potency by the Arab Spring, has endured ever since. When Morsy was overthrown, King Abdullah said the Kingdom "stood and still stands today with our brothers in Egypt against terrorism, extremism and sedition." Financial support for the Sisi government flowed from Saudi Arabia and the UAE.
Nawaf Obaid, author of the forthcoming "The Failure of the Muslim Brotherhood in the Arab World," says that "one of King Abdullah's most enduring legacies will be the decisive role he played to stop and roll back the Muslim Brotherhood's grand design to take over most of the Arab world after the Tunisian revolution sparked the so-called Arab Spring."
In power, Morsy's only achievement of note was to broker a ceasefire between Hamas and Israel after eight days of violence in Gaza that had claimed more than 150 lives.
But many of Morsy's supporters quickly lost faith in him -- as his administration lurched from one crisis to the next. He wasn't even the Brotherhood's first choice as their presidential candidate. Gerges says he was a "political pygmy, with limited intelligence and charisma, along with a penchant for making overblown promises and pronouncements."
Unable to gain control over Egypt's judiciary and its extensive security apparatus, Morsy granted himself sweeping powers by decree, prompting those who had led the protests against Mubarak to accuse him of carrying out a coup against legitimacy and the rule of law. They feared that the real intent of Morsy and the Brotherhood was to create an Islamic State.
Egypt descended into political paralysis, compounded by a worsening economic crisis. Protests against Morsy swept through Cairo, just like the unrest that had broken Mubarak's long rule and ushered in Egypt's brief flirtation with democracy. Morsy and other Brotherhood leaders misread the genuine popular unrest as part of a conspiracy by their enemies.
After the 2013 coup, Morsy was charged with leaking state secrets to Qatar, ordering supporters to attack protesters during a sit-in outside the presidential palace and spying for Hamas. His convictions -- and lengthy prison sentences - meant he stood little chance of being released so long as Al-Sisi remained in charge.
Al-Sisi's government has conducted a remorseless campaign against the Brotherhood, which it declared a terrorist organization in 2013. That campaign began with the deaths of hundreds of Brotherhood supporters six weeks after Morsy was deposed, when police descended on a protest camp in a Cairo suburb.
Once again the group has been forced deep underground. Many of those able to escape sought sanctuary in Turkey.
But the world has moved on. The Obama Administration made some half-hearted criticisms of Morsy's ouster; the Trump Administration has embraced al-Sisi. President Trump welcomed him to the White House for a second time in April, calling him a 'great person.'
'We are very much behind President al-Sisi," Trump said.
To the US, Egypt is an important part of the front against Iran, just as it was during Mubarak's tenure.
Russia has also cultivated a close relationship with al-Sisi.
"Just look," President Vladimir Putin said in 2014: "There are problems in Afghanistan; Iraq is falling apart; Libya is falling apart. If General al-Sisi had not taken control in Egypt, Egypt would probably be in turmoil now as well."
In death as in his brief spell in the political limelight, Morsy remains a polarizing figure. In Istanbul, President Recep Tayyip Erdogan said that "History will not forget the tyrants who imprisoned him, threatened him with death and made him a martyr."
Some of Morsy's younger supporters have been radicalized by the outlawing of the Brotherhood and have turned to violence, carrying out armed attacks against the military and police. But they are an irritant rather than a threat to a government that has seized every lever of power.
And yet the Muslim Brotherhood is far from extinct, despite the mass arrests and arbitrary killings. In a recent report the Carnegie Middle East Center wrote that "Because Turkey, Qatar, and London are centers of the Muslim Brotherhood's administration, the exiled leadership is out of reach of the Egyptian authorities."
The Brotherhood is also used to repression and has a unique structure for surviving. As the Carnegie report concluded, "Egypt's political destiny will continue to be defined by the clash between the regime and Islamists."
And in the process, the voices of the young, urban and relatively liberal Egyptians who flooded into Tahrir Square in 2011 will be stifled and marginalized.
This story has been updated with new information.