A PRIL 30TH DAWNED promisingly in Venezuela. Juan Guaidó, acknowledged as the country’s interim president by many democracies and millions of Venezuelans, appeared outside an air-force base in Caracas flanked by national guardsmen to declare that the end of the dictatorship was imminent. By his side was a leader of the opposition, Leopoldo López, who had somehow been freed from house arrest. His presence, and that of the guards, suggested that Venezuela’s security forces were ready at last to withdraw their support for Nicolás Maduro, who has ruled his country catastrophically and brutally for the past six years.

Thus began two days of rumour, intrigue and violence (see article). As The Economist went to press the regime was still in charge and the generals were proclaiming their loyalty to it. Mr Maduro had appeared on television to declare that the “coup-mongering adventure” had failed. Yet this week’s events reveal that his hold on power is weaker than he claims. Mr Guaidó, the United States, which supports him, and the commanders of Venezuela’s security apparatus must work together to put an end to it.

That may well have been the plan. John Bolton, America’s national security adviser, said on April 30th that senior regime officials, including the defence minister and the commander of the presidential guard, had agreed to dump Mr Maduro and transfer power to Mr Guaidó. Mike Pompeo, America’s secretary of state, later insisted that Mr Maduro had been worried enough to have a plane waiting to spirit him to Havana but was dissuaded by his Russian allies.

How true these claims are and what went wrong is uncertain. A letter on social media attributed to the general in charge of Venezuela’s intelligence service, who has abruptly left his job, gave Mr Bolton’s assertion some support by saying that people close to Mr Maduro were negotiating behind his back. Some newspaper reports say that the plan was to remove him on May 2nd but that Mr Guaidó had acted early, perhaps because Mr Maduro had got wind of the plan. The plotters got cold feet.

The false start, if that’s what it was, shows the way ahead. Both Mr Guaidó and the administration of Donald Trump will need to induce the top brass to switch sides by making clear that there is a role for them in a democratic Venezuela. The army gave up power in 1958 and helped usher in civilian rule. Today’s opposition and soldiers could co-operate in a similar fashion. Although Mr Maduro and his closest associates need to go, Mr Guaidó should welcome less tainted leaders of the chavista regime into a transitional government, which would relieve the humanitarian crisis while preparing for free elections. That could yet take many months.

The Trump administration has lumped Venezuela in with Cuba and Nicaragua in a “troika of tyranny”. It seems as eager to dislodge Cuba’s 60-year-old communist regime as it is to get rid of Mr Maduro. To that end it recently intensified America’s embargo on the island, including by letting American citizens sue European and Canadian companies that do business using Cuban assets stolen after the revolution.

American disdain for Cuba’s regime is justified. Its hundreds of spies in Venezuela help keep Mr Maduro in power. But the swipes at Cuba will tighten this bond precisely when America should be trying to prise it apart. Lawsuits against European firms will frustrate concerted diplomatic action against Venezuela. In the cause of removing Mr Maduro, America should for the time being set its quarrel with Cuba to one side.

The crucial choice lies with Venezuela’s army commanders. Mr Maduro’s misrule offers them no future. It has crushed the economy, starved the people, strangled democracy and forced more than 3m Venezuelans into exile. The hardship is bound to worsen with new American oil sanctions this year. The generals must begin to act like patriots. They need to destroy the regime, before the regime destroys their country.