BOGOTÁ, Colombia — Fugitive Venezuelan soldiers have declared a rebellion against “the murderous tyranny” of the president. Dissident officers have fled the country, seeking asylum. Grenades have been fired at the Supreme Court and, this weekend, assailants under the command of a mutinous captain attacked an army base, making off with weapons.
As Venezuela reels from a crippling economic crisis and deadly street protests, the military has often served as the guarantor of President Nicolás Maduro’s continued power over the country.
But daring challenges to his rule in recent weeks have laid bare a split within the military that could ultimately determine the nation’s fate: a growing number of officers are openly breaking ranks with the president and taking up weapons.
“They speak of resistance, now they think that the model is to use arms,” Cliver Alcalá, a retired Venezuelan general and government critic, says of those who have rebelled.
Venezuela has a history of coups and attempted overthrows at times of crisis, and many in the country now wonder if this is one of those times.
But the nation’s leaders are keenly aware of that, too, and as they face their greatest turmoil in years, they appear to have come prepared: The government has spent years ensuring that the military’s top commanders are deeply invested in the status quo.
In a single day Mr. Maduro promoted 195 officers to the rank of general. Venezuelan generals, more than 2,000 strong, enjoy a range of privileges, from lucrative control of the food supply to favorable rates for exchanging dollars.
Eleven of the 23 state governors in Venezuela are current or retired generals, along with 11 heads of the 30 ministries, giving them an extraordinary stake in preserving the government’s control over the country.
And the defense minister, Vladimir Padrino López, an army general, has been granted an even more lucrative arrangement, with expanded powers to control the country’s ports, as well as parts of the oil and mining industries.
“Maduro has made sure to give many rewards to senior military officers in exchange for loyalty,” said John Polga-Hecimovich, a political scientist who studies Venezuela at the United States Naval Academy. “While he is completely dependent on them to stay in power, they have much to lose if he is gone.”
Mr. Maduro’s crackdown against the street protests is drawing widespread condemnation. On Tuesday, the United Nations said that the government had used excessive force against demonstrators and that security forces and pro-government armed groups had caused more than half of the 124 deaths that have accompanied this year’s protests. Eight members of security forces had been killed, the United Nations said.
Mr. Polga-Hecimovich pointed to what he called the “four P’s” — purges, promotions, politics and profit — that have kept many military leaders loyal to the government. The purges and promotions date back to President Hugo Chávez, who picked Mr. Maduro to be his successor before he died in 2013.
Mr. Chávez participated in an unsuccessful uprising against the government when he was an army lieutenant in 1992. A decade later, he was also the victim of a coup attempt as president.
After regaining control, Mr. Chávez embarked on a major effort to rid the military of anyone who might challenge him again. He also instituted a new brand of military education to indoctrinate the armed forces to his Socialist-inspired movement, even requiring soldiers to attend rallies. Promotions became based less on performance and more on leftist leanings, former soldiers say.
“There was an ideological filter to the most senior ranks,” said Harold Trinkunas, a Venezuelan political scientist and a fellow at the Brookings Institution.
By most accounts, Mr. Maduro, a civilian who lacks the charisma and popular support of his predecessor, went even further to strengthen ties with the military’s top brass, promoting Néstor Reverol, a former National Guard head accused of drug trafficking in the United States, to head the interior ministry.
The president also elevated more than 800 officers to the rank of general or admiral, not only ensuring the loyalty of those who get promotions but also diluting the authority of individual officers who might challenge the president, according to Mr. Polga-Hecimovich.
Even the food supply has become a source of patronage, experts say. In June 2016, faced with food shortages and riots spreading across the country, Mr. Maduro put the military in charge of factories and gave it control over distribution. While that helped with the looting, experts say, it also allowed top officers to gain control over the profitable black market in food.
Most midlevel officers, however, are far removed from the high ranks or patronage systems on offer from the government. Instead, said Raúl Salazar, a retired general who served as defense minister under Mr. Chávez, they see a deepening poverty caused by the food and medicine shortages that are plaguing the country.
“Their families, their friends, their acquaintances, everyone is suffering and they begin to ask themselves if it’s getting better or worse,” General Salazar said. “Everyone has the same voice that talks to them each day, and that is their conscience.”
On Sunday, a fugitive army captain named Juan Carlos Caguaripano, released a video of himself standing before a group of armed men he declared were in “legitimate rebellion” and demanded a “transitional government and free general elections.”
Around that time, a group of 20 people launched an assault on a military base in the state of Carabobo, near the capital, Caracas, an attack the government said had been organized by the rebel captain. Soldiers fought the group for three hours and at least half of them made away with a number of weapons, they said.
On Monday, Mr. Padrino, the defense minister, said the weapons included high-powered assault rifles and grenade launchers. The attackers reached them with help of a lieutenant at the base, he said.
Mr. Alcalá, the retired general, who headed the base for several years, said: “They would have needed someone inside the unit with the key. There are so many personnel problems within the armed forces, so many problems with morale.”
Indeed, even before the attack, Captain Caguaripano seemed to be gaining a following. In a July 26 video, a rogue soldier named Javier Nieto Quintero pledged allegiance to him from an undisclosed location in the jungle, where he said he was in exile. Mr. Nieto, who is believed to have lived in Miami and Colombia, encouraged Venezuelans to rise up against government.
“The only thing we should be negotiating is what jail Maduro will be in,” he said.
Still, as the attacks continue without the support of senior officers, the unrest is looking more like guerrilla warfare than a coup. On June 27, a pilot from Venezuela’s police corps named Óscar Pérez commandeered a helicopter and shot grenades at the Supreme Court. Mr. Pérez also released a video urging Venezuelans to rebel.
Attacks by security forces aligned with the opposition are troubling to Mr. Trinkunas, the military historian, who notes that the government has armed civilian squads known as colectivos and independent militias that could find themselves in conflict with rogue soldiers as they try to defend Mr. Maduro.
To General Alcalá, the attacks mark a departure from the military order that he spent years trying to defend.
“We have to reject this, all Venezuelans who believe that the solution must come from the Constitution,” he said.
Correction: August 8, 2017
An earlier version of this article misidentified Harold Trinkunas, a Venezuelan fellow at the Brookings Institution. He is a political scientist, not a military historian.