IT MAY be sinking ever deeper into slump, misery and corrupt dictatorship, adorned only by threadbare revolutionary rhetoric, but Venezuela has retained a surprising stability. Over the past 18 months Nicolás Maduro, the president, has pulverised the democratic but divided opposition. Most of Latin America did not recognise the rigged election in May in which he arranged another six-year term for himself, but the region has not taken any action to bring about the democratic transition it wants.

And yet Mr Maduro is far from invulnerable. That was dramatically highlighted on August 4th, when an apparent assassination attempt against him played out on live television. There is still much that is murky about the incident, in which two drones carrying explosives flew towards Mr Maduro as he was speaking at a ceremony of the paramilitary National Guard in central Caracas. One ricocheted against a block of flats, starting a fire. The other was supposedly shot down. Officials said that seven people were injured.

Mr Maduro blamed the “far right”, Colombia’s outgoing president, Juan Manuel Santos, and shadowy forces in Miami. He has denounced a score of plots since he took over from the late Hugo Chávez in 2013. This time, as before, he offered no evidence that foreign powers were involved. Colombia’s government dismissed the claim as “absurd”. Some in the opposition believe that Mr Maduro’s regime staged the event to rally its own flagging supporters and provide a pretext for a crackdown. At a congress of the ruling party last month there was open criticism of Mr Maduro’s management of the economy. This week the government detained an opposition legislator and ordered the arrest of Julio Borges, an opposition leader in exile in Colombia.

But the regime probably did not attack itself. Dictators depend on projecting an image of omnipotence. In the television footage, Mr Maduro looked befuddled; the massed ranks of the National Guard broke discipline and ran off in panic. And Mr Maduro has rarely required an excuse to crack down. His security forces killed many of the 160 protesters who died last year. His regime’s dungeons hold more than 250 political prisoners, some of whom have suffered torture. Dozens have fled into exile to avoid arrest.

The main opposition parties condemned the attack. But a group calling itself Soldiers in T-shirts claimed it. The group is linked to Óscar Pérez, a police captain who led a brief guerrilla attack on the regime and was killed by government forces while trying to surrender. A former municipal police chief who says he is part of “the resistance” to Mr Maduro said he was involved in the drone attack. Such groups are small, and the attack looked amateurish. But it is unlikely to be the last attempt to unseat Mr Maduro.

That he has lost the support of his people was clear when the opposition trounced him in a legislative election in 2015, prompting him to rule as a dictator. Three things have sustained him since then: oil revenue, the armed forces and Cuban security aid. He can no longer be certain of the first two.

Mainly to keep the armed forces happy, in November he handed control of the oil industry to a National Guard general with no relevant experience. According to OPEC estimates, oil production has fallen to 1.3m barrels per day, down from 2m in October. That is one of several ways in which Venezuela is becoming a failed state. It is suffering hyperinflation (prices are doubling every 25 days). The regime uses subsidised food to secure loyalty. But it now faces a vicious circle: for many employees, devalued wages no longer cover the cost of getting to work on a collapsing public-transport system. Oil workers are resigning in droves, some joining perhaps 2m Venezuelans who have emigrated since 2015. Mr Maduro has partially lifted exchange controls in a seeming attempt to boost remittances from those migrants, and has promised a new currency. That won’t be enough to tame inflation.

Despite the generals’ privileges, many in the army suffer privations, too. Discontent in the ranks has grown. Dozens of officers have been arrested over the past year or so, including generals who were close to Chávez. The only thing preventing a coup against Mr Maduro is his team of Cuban spies. The intelligence services broke up a serious plot in May.

Mr Maduro leads the pro-Cuban faction in the regime. Another has closer ties to the armed forces. By blocking democratic change and by failing to halt Venezuela’s decline, Mr Maduro has made himself vulnerable to removal by force. That could happen tomorrow—or never. Uneasy lies the head that fears a drone.