Venezuela, Nicolás Maduro’s dwindling band of foreign supporters like to claim, is a theatre in a new cold war. Donald Trump’s administration and his hawkish foreign policy advisers, with their occasional threats of military intervention, provide the perfect props. So does Jair Bolsonaro, the new far-right president in Brazil. But the real contest in Venezuela is between democracy and dictatorship. Maduro leads a corrupt authoritarian regime that has stolen and broken a once-prosperous country, staging a coup against its own constitution.

On Saturday 12 January, a power cut at the University Hospital in Caracas caused the deaths of six patients, according to a union representative. It was not an isolated incident: in the two months from mid-November, 40 hospitals in Venezuela monitored by a local doctors group suffered power cuts lasting an average of three hours a day. But the deaths at the University Hospital were a particular embarrassment to Maduro, Venezuela’s ruler since 2013. Highlighting his country’s descent into criminal public mismanagement, they happened just after he was inaugurated for a second six-year term as president, in a sparsely attended ceremony at the supreme court and not the national assembly, as the constitution requires.

For most governments in the Americas, for the European Union and for many Venezuelan people, that ceremony was bogus. For them, Maduro is no longer a legitimate president, but simply a dictator who staged his re-election last year in a fraudulent poll from which the main opposition parties were barred. Over the past fortnight, Venezuela has seen nationwide protests, including in poor neighbourhoods traditionally loyal to Hugo Chávez, Maduro’s predecessor and mentor.

They culminated in massive marches last Wednesday, during which Juan Guaidó, the new, young speaker of the opposition-controlled national assembly, proclaimed himself to be the country’s interim president. In a co-ordinated move, the United States and a dozen other countries in the Americas recognised Guaidó. For several hours, power seemed to hang in the balance. Then senior military commanders reaffirmed their support for Maduro and rejected what they claimed was a “coup”. Guaidó has gone into hiding.

After the police killed two dozen demonstrators last week, the protests are likely to die down. But the battle for power in Venezuela is not over. Maduro has broken off relations with the US. He can count on support from Cuba and Russia and the quiescence of China. But his relative international isolation is evident. He presides over a broken economy and a country from which around 10% of the population have fled in the past three years in search of the subsistence, safety and opportunity they are denied at home. Polls show that most Venezuelans have little time for the opposition, long racked by opportunist internal squabbles. But they also show that the vast majority want change. And in Guaidó, who is the nominee of Leopoldo López, an opposition leader under house arrest, it has at least found a fresh face.

The date of last week’s marches, 23 January, is significant in Venezuela. On that day in 1958, a popular uprising overthrew a military dictatorship, ushering in a stable two-party democracy. Fuelled by oil exports, Venezuela became the wealthiest country in South America and a haven for political exiles from military dictatorships elsewhere on the continent in the 1970s. Then the oil price collapsed and popular discontent at austerity and corruption saw the election in 1998 of Chávez, a charismatic army officer who had led a failed coup.

Nicolas Maduro is sworn in as president at the supreme court in Caracas. Photograph: Ariana Cubillos/AP

Chávez had the good fortune to preside over the biggest oil boom in the country’s history. He is still revered by half the population, who recall his social programmes and popular touch. But by the time he died of cancer in 2013 he had bankrupted his country, running up debt and strangling the private sector with controls while replacing its output with imports. He replaced a flawed social democracy with a clientelist society, in which benefits and food rations are handed out in return for political loyalty. The state has been hollowed out into corrupt fiefs, controlled by armed groups, legal or not. In an emblematic case, Chávez’s former treasurer admitted in a New York court to taking $1bn in bribes, a sum greater than all the bribes paid by Odebrecht, Brazil’s notoriously corrupt construction company.

Venezuela is suffering one of the worst peacetime economic collapses, akin only to that of Robert Mugabe’s Zimbabwe. The economy has shrunk by almost half since 2014, while hyperinflation destroys the value of wages. This collapse is not the result of low oil prices, still less of sanctions imposed by the US (which mainly affect individual leaders of the regime). Other oil producers have weathered lower prices, but in Venezuela the regime’s mismanagement has seen oil output fall by almost two-thirds since Chávez took office.

Venezuelans turned against Maduro in a legislative election in December 2015, when an opposition coalition won 56% of the vote and a two-thirds majority in the national assembly. That prompted Maduro to rule as a dictator; the assembly has been reduced to an impotent NGO, stripped of its constitutional powers. Most of the opposition’s leaders are in jail, in exile or intimidated. Torture of prisoners is common, according to a recent report by Human Rights Watch. Maduro and his cronies cling on thanks partly to hundreds of Cuban spies, who have foiled several coup plots in the past two years.

Cuba’s leadership could at least point to past achievements, to world-class health, education and hurricane-defence programmes. In return for cheap oil, Cuba is propping up a feral regime that rules a country in which the vast majority have fallen into poverty and child mortality is rising sharply. As South American countries suddenly face absorbing 3 million Venezuelan immigrants, Maduro’s regime has become a regional problem. In Caracas, the military offers Maduro the loyalty of a partner in crime. The generals fear that Guaidó’s offer of an amnesty for the billions they have stolen will not be honoured. Maduro will no doubt try to limp on through further repression, but he may run out of money. The US is unlikely to attempt a military invasion but it is looking at ways to channel payment to Guaidó and the assembly for the oil it still imports.

A swift negotiation in which Maduro departs and a free election is called is the best hope for Venezuela. This route has been offered to Maduro before and he has rejected it. Things may get worse for Venezuelans before they get a chance to recover their country.

Michael Reid is the author of Forgotten Continent: A History of the New Latin America. He is a columnist and senior editor at the Economist.