Mohamed Morsi greets supporters during Egypt's June 2012 presidential election.Mohamed Abd El Ghany / Reuters

In June 2012, I stood with hundreds of thousands of Mohamed Morsi’s supporters in Cairo’s Tahrir Square, where they prayed that the Egyptian military, still powerful behind the scenes, would allow a fair ballot count. Independent tallies suggested that the Muslim Brotherhood’s Morsi had squeaked past the military’s preferred candidate in Egypt’s first-ever free presidential election—the only question was whether the vote would be rigged.

“We will stay in this square until Morsi wins,” an engineer named Khaled told me. “We will stay here even after he wins.” When the results were announced, pandemonium broke out. Khaled hugged me, a complete stranger, with such force that his eyeglasses snapped.

At Morsi’s nearby campaign headquarters, his spokesman, Yahia Hamed, waxed poetic when I asked him how a Morsi administration would treat the police officers who had harassed, jailed, and tortured Muslim Brothers for more than half a century.

“I will quote Nelson Mandela, who said when he was released from prison, ‘Let us surprise them with our generosity,’” he told me. “So we, too, must surprise them with our generosity.”

It was not to be. In power, Morsi—who died yesterday after collapsing in court—and other senior Brotherhood politicians rammed through unpopular laws and wrote a new constitution that was anathema to liberal and secular Egyptians. There was no consensus, no consultation. Morsi tried to place his own decision making beyond any accountability or oversight, like every other dictator and tyrant in Egypt’s history. Eventually all but his most doctrinaire supporters turned against him. The best that one former Brother could say about Morsi after his election was, “At least he won’t shoot us in the streets.” In the fall of 2012, thuggish Morsi supporters tortured anti-Morsi protesters on the grounds of the presidential palace, proving even that minimal hope unrealistic.

Sadly, a great many Egyptian critics took their dislike of Morsi a step further, and decided democracy wasn’t worth the trouble. Casting about for a solution to the problem of Morsi, they thought they found their savior in the military.

It was a sign of how, even at the high-water mark of Egypt’s revolutionary moment, people power had its limits. Idealists, reformers, and dreamers toppled Hosni Mubarak’s 29-year dictatorship, and had galvanized such broad and deep public support that, for a time, even the military feared for its perch. But disorganized revolutionary parties, new to politics, fared poorly in the legislative elections, and none of their candidates made it to the second and final round of the presidential race.

The military and the Muslim Brotherhood, polar opposites in other ways, still had the best ground game: blind loyalists, organized cadres, and money.

Revolutionaries, liberals, and socialists mistrusted Morsi, who as a candidate already had displayed an authoritarian and sectarian streak. He was a mediocrity in the Brotherhood leadership, enlisted to run only because the top choice had been disqualified. Morsi persuaded a slim majority to vote for him on the promise that he would govern for everybody, and not just for the Brotherhood. He met with revolutionary youths and activists, and promised he would include them in a broad coalition to reform Egypt’s rotten system. At his inaugural speech in Tahrir Square, Morsi invoked dreamy utopianism, and pledged to be accountable “for all Egyptians,” police officers as well as peasants, soldiers as well as protesters. “As for myself, I don’t have rights. I only have duties,” he said. He instructed Egyptians to obey him only if he continued the revolution and delivered its central demands: bread, freedom, and social justice.

He singularly failed to live up to those ideas, and after a year in office, Morsi was unceremoniously ousted in an army coup. The new dictator was an army intelligence general in whom Morsi had mistakenly placed his trust. That general, Abdel Fattah el-Sisi, manipulated grassroots organizations and harnessed public opinion—which had genuinely turned against Morsi’s sectarianism, corruption, and religious extremism—to end Egyptian democracy itself.

Today, Sisi has replicated the unaccountable and incompetent one-man rule that sparked the revolt of 2011. He has studied history, however, in the hope of avoiding the fate of his predecessors, and concluded that his military predecessors were too soft. Under Sisi’s regime, any dissent at all, even if entirely symbolic, is too much.

That’s why Morsi utterly disappeared after his arrest. His family reportedly was allowed to visit him in prison only three times over the course of his six-year detention. He was held in solitary confinement, denied medical care, and allowed to address judges only from inside a glass-enclosed cage during infrequent court appearances. Egyptian authorities routinely withhold essential medical care such as dialysis, insulin, and heart medication, not only as a form of torture, but also as an adjunct to the arbitrarily and summarily dispensed death penalty.

The abuse Morsi suffered in detention is, notably, standard operating procedure for Egypt’s tens of thousands of political prisoners. Powerful or minor, Islamist or secular, any Egyptian dissident is today considered a threat to the state and is subjected to its maximum coercive power. Every notable political faction has been subject to the same indiscriminate sledgehammer, from youth movements to a breakaway alliance of secularists and former Muslim Brothers, as well as the Brotherhood itself and even politicians who loyally backed Sisi’s coup but dared to disagree with the new dictator about minor policy matters.

Largely because of the contrast with Sisi’s villainous regime, Morsi is sometimes remembered too fondly. He was an uninspiring orator, widely mocked for malapropisms, as when he compared the global order to spaghetti. But he wasn’t a benevolent buffoon. He had a doctorate from the University of Southern California and a lifetime of experience as an underground leader of a secretive and hierarchical religious order. By the time he stumbled into the presidency, he had come to mirror the authoritarian system he had sought his whole life to overthrow.

The arrogance, incompetence, and maximalism of Morsi’s presidency suggest a powerful lesson for those who hope to transform unjust governments in Algeria, in Sudan, in whichever cruelly governed regime next faces its comeuppance. Any successful revolution will have to first tame the military and second build an inclusive coalition that promotes rights for all.

Unfortunately, the epic scale of the current dictatorship’s abuse of power makes it all but impossible to have a reckoning with Egypt’s painfully brief revolutionary moment. Morsi, for all his many flaws, was the only fairly elected leader in Egypt’s entire millennia-long history. He came to power as the result of a democratic process, and initially claimed political support from a wide range of Egyptians, not just from Muslim Brotherhood members.

The greatest culprit in Egypt, throughout its painful modern history, has been the military, which has misruled the country and subjected its citizens to rapacious levels of violent repression. But Morsi and his faction of Muslim Brothers played their own key role in destroying the moment of possibility that began in Tahrir Square on January 25, 2011.

With his tragic death, Morsi will forever be inscribed in Egyptian history as the victim of military dictatorship, another symbol of democracy denied. His most enduring legacy, however, should be as a cautionary tale. To defeat dictatorship, true democratic leadership is required.

We want to hear what you think about this article. Submit a letter to the editor or write to letters@theatlantic.com.