U.S. officials have developed a bad habit of endorsing military meddling in global politics — ironically, in the name of democracy.

Some heralded the resignation of Bolivia’s president Evo Morales this week after nearly 14 years in power as a victory for democracy. Although his regime remained popular, Morales’s increasingly brazen efforts to serve a fourth term in office had sparked violent protests. Though Morales initially appeared determined to hold on to power, the turning point appears to have been the defection of Bolivia’s military and security forces. On Sunday, the commander of the armed forces publicly pressured him to step down.

While there is some debate about whether the developments in Bolivia constitute a “coup” or a “popular revolution,” the military’s role in Morales’s ouster has many of the hallmarks of a typical coup attempt. Coups are usually understood as illegal, overt attempts to unseat the executive. Those that involve generals and other high-ranking officers are frequently accomplished without the use of violence. Instead, they can take the form of public pressure to resign.

President Trump applauded Bolivia’s military for pressuring Morales. The developments in that country, he claimed, brought the world “one step closer to a completely democratic, prosperous, and free Western Hemisphere.”

This is hardly the first time U.S. officials have implied that military intervention in politics might help countries usher in more democratic rule. Last April, when Venezuelan opposition leader Juan Guaidó called upon soldiers to join him in ousting President Nicolás Maduro from power, Secretary of State Mike Pompeo suggested Guaidó’s proposed coup would result in “a peaceful democratic transition.”

Similarly, in 2013, when Egypt’s military leaders ousted Mohamed Morsi, the country’s first democratically elected ruler, from power, Obama administration officials portrayed it as an expression of the popular will, rather than a coup attempt. Secretary of State John F. Kerry claimed that in ousting Morsi, the military was “restoring democracy” rather than seizing power.

The temptation to endorse the domestic political maneuverings of military leaders against unfriendly regimes is clearly strong for U.S. policymakers. In recent years, moreover, a number of observers have suggested that coups might be the only way to remove entrenched dictators from power. Coups sometimes succeed in replacing repressive rulers with more democratic ones, and since the end of the Cold War, these so-called “good coups” — those that are quickly followed by competitive elections — have risen in number. Examples include the coups in Niger in 1991 and Guinea-Bissau in 2003, both of which preceded free and fair elections.

But faith in the military to restore democracy is misplaced. There is, in fact, scant evidence that coups and other forms of military intervention result in more democratic rule. Notwithstanding the recent uptick in the number of “good coups,” coups still more often than not simply replace one dictator with another.

Just as importantly, those military interventions that are followed by elections rarely bring about lasting change. In Egypt, for instance, human rights organizations documented mass, arbitrary arrests, the detention of protesters and human rights workers, new restrictions on nongovernmental organizations and repression of political opposition. The same misplaced optimism followed the 2006 coup in Thailand.

What makes “good coups” lead to bad outcomes? The basic answer is that letting military elites’ interference in the political process go unchecked ultimately undermines norms of civilian control of the military that are a prerequisite for stable, democratic rule. It encourages military officers to see themselves as above the law. Hence, when civilian elites invite military officers to weigh in on politics, it is difficult to get them to stop. Morales himself learned this the hard way. When the current crisis began to unfold, he appealed directly to the military to help him remain in power, only to see it throw its weight behind his opponents.

It is a matter of long-standing U.S. policy, moreover, to bolster the norm of civilian control of the military abroad, as reflected in State and Defense departments’ security-assistance programs that devote substantial resources to convincing foreign militaries to accept that control. The opportunistic deviations from these principles by successive presidential administrations only undermine such commitments while achieving little in the way of real democracy promotion.

A response to the crisis in Bolivia consistent with promoting democratic rule would involve simultaneously condemning both the alleged electoral fraud that triggered the recent crisis as well as the military’s response to it. The temptation to rely on the military to check would-be authoritarians will continue to crop up in the context of mass protests. But the longer-term survival of democratic rule depends on resisting it.