If the Venezuelan military withdraws support for President Nicholás Maduro, his end may be near.

A large middle class has been thrust into poverty in Venezuela. Food and medicine are in short supply, and malnourishment is widespread. Security forces have violently beaten back opposition protesters and jailed leading opposition figures.

Reigning over this disaster is Maduro, who was narrowly elected in March of 2013 following the death of leftist leader Hugo Chávez. Amid the stunning decline, many are asking, what will the military do?

My research on civil-military relations in Latin America and other regions finds that a military’s loyalty to a regime can waver when it is confronted with mass protests. If the military grants loyalty to a leader, it comes at a price. But if the armed forces withdraw their support by remaining in their barracks and refusing to silence the protests, the leader’s days are numbered.

In Latin America, the former Soviet Republics and the Middle East, I have found that as the numbers of protesters swell, police often retreat because they are not equipped to contain mass demonstrations. At that point, when the armed forces choose to stay in their barracks rather than head to the streets to enforce order, political leaders quickly fall from power. This was true in every case.

For example, this occurred in Argentina in December 2001 when President Fernando de la Rúa presided over a financial collapse of epic proportions. Citizens could no longer withdraw money from their own checking and savings accounts, resulting in widespread rioting and looting. When the president asked his military to intervene to restore order, they refused. Immediately thereafter, De la Rúa was forced to flee for his life by helicopter from the rooftop of the presidential palace, as throngs of angry protesters descended.

Similar scenarios unfolded during the revolutionary uprisings in Georgia (2003) and Ukraine (2004), and more recently in Tunisia (2010) and Egypt (2011) during the Arab Spring. After the military in each of those countries made it known it would not silence the protesters, presidents were forced to step down.

In Venezuela itself in 2002, President Hugo Chávez was momentarily thrown out of power after he had ordered the military to violently subdue a mass demonstration. Soldiers refused to obey. Instead, many participated in the coup plot to unseat him.

President Maduro certainly recalls that event vividly, which may explain why he has not pressed soldiers to crack down on demonstrators. But what if things really begin to unravel for him? Will he try to play his final card, begging his generals to intervene to restore political order and save his regime?

So far, the Venezuelan armed forces have remained dedicated to the Maduro government and the cause of “Chavismo,” a left-wing blend of socialism, populism and nationalism. A military that has stayed this loyal for this long to a hugely unpopular leader is motivated by power, perks and principles. Indeed, many militaries are.  Maduro, like Chavez, has invited the armed forces to occupy some of the highest political offices in state and federal government. According toThe New York Times, 11 of 23 state governors are military men, and one-third of the national ministries are run by uniformed officers. Officers have gotten a real taste of political power, and they seemingly like it.

The monetary perks of working in Venezuela’s military are significant. Military personnel have been rewarded with salary increases in recent years that have exceeded rates of inflation, while other public sector employees have seen wages stagnate. Armed forces have also enriched themselves through control over lucrative drug trafficking networks.

They have also been put in charge of the production and distribution of a very scarce commodity these days – food – which has predictably given rise to black markets and smuggling operations that have lined military pockets.

Finally, both Chávez and Maduro promoted soldiers who professed utmost dedication to their ideological cause, while purging the less committed from the ranks. The regime has used military academies to indoctrinate its soldiers with its brand of socialist anti-imperialism. Officers are expected to be members of the official party, while adopting the motto, “fatherland, socialism or death.” Maduro has torn a page right out of the Cuban socialist playbook to assure military fidelity.

But soldiers are also guided by professional norms regarding the missions they are assigned. The people of the military prefer not to take missions that are, in their mind, professionally degrading. For example, police work – including crowd control – is a mission soldiers commonly resent doing because it is not what they were professionally trained to do.

For now, Maduro can count himself fortunate that when it comes to doing the dirty work of violently repressing the demonstrators, he can turn to another force: Venezuela’s National Guard. The National Guard has taken on the burden of internal security along with the national police, allowing the regular army to focus on external defense.

But what might occur if the National Guard itself says enough?

The military will have to weigh its options, in light of two important possibilities.

If the military participated in violent repression, it would place them in a vulnerable position, should the president eventually fall. A new government would likely come to power, launch human rights inquests and trials against perpetrators, putting many officers’ careers in jeopardy.

In a second possible scenario, the Maduro government endures but the military is divided by conflict within its ranks. Many mid- to lower-ranking officers in Venezuela are not only less ideologically committed, but are less economically privileged. They can more readily empathize with the plight of millions of ordinary Venezuelans. It is from these ranks that recent military rebel groups have emerged.

Should these rebellious elements grow, they may come to blows with loyalists, placing in peril the cohesion of the military. At that point, military leaders may very well decide that reunification of their institution is more important than regime loyalty. They may help drive the last nail into the coffin of a much reviled regime by tossing Maduro out themselves. Then, if they are wise, the generals could call for new elections, and swiftly return to the barracks.

This article originally appeared on The Conversation 

David Pion-Berlin is a Professor of Political Science at the University of California, Riverside