People attend a rally for peace in Cochabamba, Bolivia, on November 21, 2019.Danilo Balderrama / Reuters

After the Cold War, it was tempting to believe that when dictatorships ended, democracies were likely to take their place, and that once democratic institutions were in place, they were likely to persist. The truth is less upbeat.

Revolts against established or aspiring dictators ushered in democratic institutions in countries from the Czech Republic to Slovenia. Elsewhere, however, revolts against autocratic leaders failed, proved short-lived, or helped a new autocrat step into the power vacuum. In Belarus, Alexander Lukashenko built a post-communist dictatorship on the symbolic rubble of the old regime. In Russia, a brittle democracy led by a corrupt and unstable leader ultimately gave way to a repressive dictatorship under the diktat of Vladimir Putin. And in Serbia, Slobodan Milošević seized on the breakdown of Yugoslavia to erect a fascist ethno-state.

This depressing record suggests two lessons. First, it is a mistake to judge the participants in a revolt by its outcome; those who rose up against Egypt’s Hosni Mubarak were no less noble than those who ousted Tunisia’s Ben Ali, even though the result of the former protests has (so far) been a lot less rosy. Second, when people rise up against an autocratic leader, observers must temper admiration for their heroism with an awareness of the many challenges they are likely to face as soon as they have realized the most immediate—and, perhaps, easiest—goal of ousting that leader from power.

Both lessons are necessary to understand what is now happening in Bolivia.

When he came to office in 2006, Evo Morales followed the playbook for how to destroy democracy step by cynical step. He wrote a new constitution that gave him greater powers. He placed loyalists at the head of independent institutions (including the electoral commission) and influential corporations (including Bolivia’s biggest oil company). And he was unwilling to acknowledge the existence of a legitimate opposition, perpetually vilifying his adversaries as traitors.

In recent years, as Morales’s support among the Bolivian people began to slip, his attacks on democracy became more blatant. Even though a majority of his countrymen—including about half of Bolivia’s indigenous population—voted against a constitutional amendment to revoke term limits, he ran for a fourth term as president. And when he seemed to fall short of the necessary majority to win election in the first round, he engaged in what the Organization of American States decried as a “clear manipulation” of the vote. Among other measures, he tampered with the electronic tally and halted the count.

His attempt to steal the election cost Morales the support of a large number of Bolivians, including many trade unionists, indigenous people, and longtime members of his own political party. As protesters took to the street to demand his resignation, and police forces across the country refused to use force to quash dissent, Morales was forced into exile in Mexico; earlier this month, three weeks after the first round of the presidential election, he officially resigned his post. For a hopeful moment, it seemed likely that free and fair elections would determine a rightful successor, and that Bolivia could serve as an inspiration for other people suffering under dictatorships erected by authoritarian populists, from Turkey to Venezuela.

Since then, the outlook for Bolivia has soured. Morales has, from his exile in Mexico, done what he can to incite civil war. Even though he had called on the OAS to settle allegations of vote rigging, he dismissed the organization’s report as an imperialist plot, portraying it as part of a long-planned “fascist coup.” Instead of asking his supporters to organize for the next elections, he has encouraged them to seek violent confrontations with government security forces. Morales loyalists have blockaded whole cities to stop fuel or food from reaching its residents; in one video released by the interim government, Morales even appears to give tactical advice to the commanders of local insurrectionary troops.

But if Morales has tried to deepen the country’s political divisions, the interim government that succeeded him has proved similarly unwilling to defuse tensions. Because of arcane rules governing the presidential succession, Jeanine Añez, a relatively obscure and deeply conservative senator, rather than Carlos Mesa, Morales’s more moderate and better-known challenger, is leading the transition government.

Añez has a history of racist statements, including a tweet that described an important indigenous celebration as “satanic.” Faced with the genuinely hard challenge of countering Morales’s incitement to violence, she has also resorted to brutality. Since she promised security forces immunity for actions they take to reestablish order, about 30 people have been killed in clashes between the government and Morales’s supporters.

Many revolts, even those motivated by righteous motives, go badly wrong. There are two terrible scenarios for Bolivia: First, Añez might rely ever more heavily on violent repression to maintain order, turning Bolivia into a de facto military dictatorship; the darkest episodes of 20th-century Latin American history would then have made a reappearance in the 21st. Second, Morales might succeed in his desperate bid to destabilize the country, returning to power from his Mexican exile much as Napoleon Bonaparte managed to do in 1815. Even more than before, his rule might come to resemble that of his most ruthless allies: the Chavistas in Venezuela and the Sandinistas in Nicaragua.

A more hopeful possibility remains open, however. The interim government recently proposed a law that would pave the way for new elections. Even though Morales continues to denounce the government as a “dictatorship,” members of his political party just voted unanimously to approve the law. Thanks to this bipartisan compromise, the violent confrontations that have convulsed Bolivia for the past weeks appear to be subsiding. As Mónica Eva Copa Murga, the new president of the Senate and a longtime ally of Morales’s, said after the agreement, representatives of both sides of the political divide now hope “to pacify our country and above all to defend democracy.”

This makes it more likely that Bolivia will enjoy free and fair elections within the next four months. Ideally, a compromise candidate who vows to fight for a greater inclusion of indigenous groups, while staunchly opposing Morales’s long-standing attacks on democracy, will prevail. As Jim Schultz, the executive director of the left-leaning Democracy Center, told me, “I am in constant contact with our friends there across the political spectrum, and the desire for peace, and to not become Venezuela, seems to be a priority for everyone.”

It is too early to tell what will happen in Bolivia. But regardless of the outcome, the courageous protests against Morales show that the values of liberal democracy and collective self-determination hold broad appeal, and that authoritarian populists can sustain the legitimacy they derive from their false promises for only so long. When it became painfully evident that Morales was intent on assuming dictatorial powers, even many of his staunchest allies turned on him. And that is why the latest developments in La Paz should, whatever their result, inspire fear in the hearts of the world’s populist dictators.

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