IN THE flesh he seemed indestructible. Hugo Chávez was not especially tall, but he was built like one of the tanks he once commanded. He was possessed of seemingly inexhaustible energy. He travelled incessantly, both around his vast country and abroad. Each Sunday he would host live television shows lasting up to 12 hours. He would ring up ministers in the early hours of the morning to harangue them. For 14 years, everything that happened in Venezuela passed through his hands, or so he liked to think.

Yet Mr Chávez turned out to have been as reckless with his health as with his country’s economy and its democracy. Those late nights were fuelled by dozens of cups of sweet Venezuelan coffee. When in mid-2011 he revealed that he had been operated on for cancer, the lack of detail (“a baseball-sized tumour in the pelvic region”) suggested that the diagnosis had come late. He turned down an offer of care from a Brazilian hospital that has recently cured three Latin American presidents of cancer, preferring treatment in Cuba, where his condition could be kept secret.

Rather than stand aside from the presidency, he insisted that he could run his country from his Havana sickbed. After another two operations and chemotherapy, he declared himself cured. Addicted to the drugs of power and popular acclaim, he campaigned for and won yet another six-year term in an election last October.

During the campaign it was clear to those not blinded by loyalty that Mr Chávez was still a sick man. After the election he dropped out of sight, before making the sombre announcement on December 8th that he was going back to Cuba for yet another operation. If the worst happened, he said, Venezuelans should vote for Nicolás Maduro, his foreign minister and appointed vice-president, as his successor. The six-hour operation did not go well: after weeks in which close family kept a bedside vigil, joined at times by senior officials, Mr Chávez returned home last month, to die on March 5th at the age of 58.

To the end, Mr Chávez’s rule was narcissistic, with country and constitution subordinated to his whim. In the tradition of the Latin American caudillo, he wanted to die with his boots on. When he was too ill to be sworn in for his new term on January 10th, his officials, with Cuban support, resolved to disregard the constitution that he himself had pushed through in 1999 and declared that the inauguration could happen at a later date. It will be harder for them to avoid the constitution’s requirement that in the event of the president’s death an election must be held within 30 days (though in practice a poll may be difficult to organise in such a short period).

Mr Chávez is mourned by millions of Venezuelans, for whom he was a kind of Robin Hood, shouting defiance at “the empire” (ie the United States) and the “oligarchy” (ie the rich) while handing out windfall oil revenues. His opponents, many of whom saw him as a corrupt dictator, will sense deliverance. That may be premature.

A swift election may favour Mr Maduro, already the de facto president. He will benefit from a sympathy vote. The sooner he has his own mandate, the less risk there is that he will face rebellion, or at least passive resistance, from within the chavista camp. The opposition candidate will probably be Henrique Capriles. A moderate centrist and dogged campaigner, in last October’s vote he cut Mr Chávez’s margin of victory from 26 percentage points in 2006 to 11 points. But the opposition was demoralised by defeat; it fared poorly in regional elections in December, though Mr Capriles was re-elected as governor of the state of Miranda, covering much of the capital.

The bigger question in the months ahead will be how much will survive of Mr Chávez’s “Bolivarian revolution”, named for Simón Bolívar, South America’s Venezuelan-born independence hero. His reluctance to surrender power despite his illness underlined just how personal his regime was. Through a mixture of unusual political talent and extraordinary good fortune, Mr Chávez managed to make himself into a world figure, perhaps the best-known Latin American after his friend and idol, Fidel Castro. Death cut short his oft-stated intention to rule his country until 2030. And it means he will not be around to face the reckoning after 14 years of a corrupt, oil-fuelled autocracy.

Swapping baseball for revolution

Had things turned out differently, Hugo Chávez might have been a professional baseball player. That was his childhood dream. A typical Venezuelan mestizo, of mixed African, indigenous and European descent, he was born in relative poverty (though not in the “mud hut” of the title of a hagiography) in Barinas, a remote state in the llanos, the vast, tropical lowlands of the Orinoco basin. His father was a teacher, and his mother a teaching assistant. One of six brothers, he was largely brought up by his grandmother. He supplemented the family income by selling home-made sweets in the street.

By Mr Chávez’s own account, he entered Venezuela’s military academy because it had a good baseball team. He had a small role in mopping up Cuban-supported leftist guerrilla groups in the 1970s—a task that left him sympathetic to their aims. At the age of 23, he was already conspiring against the government.

In the 1980s Venezuela, previously seen as a model democracy, struggled as the price of oil, its main export, plunged and foreign debt mounted. Discontent at rising poverty, austerity and corruption exploded in three days of rioting in Caracas in 1989, and repression by the army left 400 dead. “It was the moment we were waiting for to act,” Mr Chávez said later. In February 1992, a lieutenant-colonel in command of a paratroop battalion, he made his move: he led a bloody but unsuccessful coup against the elected government of Carlos Andrés Pérez. Cashiered and jailed, he was released after just two years. He claimed that Bolívar was his inspiration.

Bolívar had long been the object of an official, quasi-religious cult in Venezuela—but a conservative one. Mr Chávez would appropriate the cult for his own ends: he was said to leave an empty chair at meetings, claiming it was occupied by the ghost of the great Liberator. His second source of inspiration was Fidel Castro: in 1994, he visited Cuba where he began a close friendship with Mr Castro, whom he saw “as a father” and who became his most important counsellor. The Cuban leader, who had long viewed Venezuela’s oil wealth as the key to sustaining his own regime in his energy-short island, would find in Mr Chávez what he had been seeking for decades: a powerful, unconditional ally in a large Latin American country.

There was a third strand to Mr Chávez’s world view. He was an army man through and through: his early heroes had been nationalist military dictators of the 1970s, such as Peru’s Juan Velasco Alvarado and Panama’s Omar Torrijos. As Enrique Krauze, a Mexican writer, has pointed out, from eclectic reading Mr Chávez acquired the conviction that history is made by great men. He was influenced, too, by Norberto Ceresole, an obscure Argentine fascist who advised him when he was first in government. His regime had an anti-Semitic undertone. The notion, peddled by some of his foreign supporters, that Mr Chávez was a moderate radicalised only by implacable opposition both at home and in Washington, does not square with the evidence.

The elected autocracy

Mr Chávez was reluctantly persuaded—probably by Mr Castro—that elections were better than force as a route to power. His promises of a clean sweep of the old order and an end to poverty and corruption won him the presidency in December 1998 with 56% of the vote. His first act was to call a Constituent Assembly, which wrote a new constitution, approved by referendum. It enshrined respect for private property, human rights and an independent judiciary. But it also expanded the powers of the presidency and the armed forces. It gave Mr Chávez a chance to appoint loyalists to the supreme court and other nominally independent institutions.

Unlike Mr Castro, Mr Chávez derived his legitimacy from the ballot box. He would win three further presidential elections, with comfortable majorities. But he ruled by confrontation and decree, rather than consensus. That triggered severe political unrest. The tensions came to a head on April 11th, 2002, when hundreds of thousands marched on the presidential palace to demand Mr Chávez’s resignation: 19 people died, many killed by snipers who were firing from surrounding buildings and were never identified. When the army refused his order to use force to suppress the protests, the president surrendered his office; his most senior general told the nation he had resigned. But after a conservative business leader proclaimed himself president on April 12th and declared the constitution abolished, the army switched sides again and restored Mr Chávez to power.

That was a turning point. An opposition strike and lockout later that year paralysed PDVSA, the state oil monopoly, but it failed. Through the medium of these conflicts, Mr Chávez neutralised all potential rival sources of power. He turned PDVSA and the Central Bank into vehicles for opaque, off-budget spending. He staffed the government, the bureaucracy, other institutions of state and the upper ranks of the armed forces according to loyalty rather than merit. He packed the courts, and gained full control of the legislature, thanks to an ill-advised opposition boycott in 2005. When a revived opposition later did well in regional and legislative elections, he stripped local government and the National Assembly of much of their powers.

Three other things had come to Mr Chávez’s rescue. The first was the spectacular rise in the world price of oil, which provided the vast bulk of Venezuela’s export earnings (see chart 1). The second was the advice of Mr Castro. Cuban officials drew up new social programmes, known as “missions”, starting with primary health care and adult education. In return for heavily subsidised oil, Cuba provided the Venezuelan government with thousands of doctors and sports trainers. Cuban intelligence and security agents surrounded Mr Chávez: he would never again be caught off-guard by street protests. The missions and the flood of oil money helped the president rebuff a referendum in 2004 that would have removed him from office. He cowed the opposition. He harassed its media outlets: today, most free-to-air television channels spout government propaganda. The names of the 3.6m who signed the petition calling for the recall referendum were published; some were sacked from state jobs or denied passports or other official services. The third godsend for Mr Chávez was George Bush. Thanks to the worldwide unpopularity of the American president, he could use his address to the United Nations to mock Mr Bush as “the devil”. He deployed his talents as a propagandist to weave a fiction to the effect that the coup attempt against him in April 2002 had been backed by the United States. In 2006 Mr Chávez won a landslide victory. At the height of his power, he declared that he was implanting “21st-century socialism”, though he never defined exactly what this was. He immediately moved to nationalise swathes of the economy, including telecommunications, electricity, cement and parts of the oil industry still in private hands.

Sent by God

Mr Chavez’s domination of Venezuela was never absolute. The two-party democracy of 1958-98 bequeathed a popular belief in democratic values. In 2007 he lost a referendum on constitutional changes aimed at making his revolution irreversible (though many of these measures were later brought into law by decree).

Everything Mr Chávez did was calculated to shore up his support among a majority of Venezuelans, while ignoring or harassing the rest. His original base was those people who laboured in the informal economy, which had blossomed in the 1980s after the end of the previous oil boom. To this he added a growing army of public-sector workers: under him, the public payroll almost doubled, to 2.4m.

Most of the motley collection of parties that backed the Bolivarian revolution were merged into the Venezuelan United Socialist Party (PSUV). Mr Chávez also created two other instruments of control: a militia of around 125,000, answerable directly to him rather than the army command; and a network of community councils which took over many of the functions (and revenues) of local government. Foreign leftist academics claimed that all this added up to an empowering “direct democracy”, superior to the incipient welfare state set up by Latin America’s social democratic governments. But to others, it looked like a top-down charade of participation, in which all power lay with the president.

Behind the propaganda, the Bolivarian revolution was a corrupt, mismanaged affair. The economy became ever more dependent on oil and imports. State takeovers of farms cut agricultural output. Controls of prices and foreign exchange could not prevent persistent inflation and engendered shortages of staple goods. Infrastructure crumbled: most of the country has suffered frequent power cuts for years. Hospitals rotted: even many of the missions languished. Crime soared: Caracas is one of the world’s most violent capitals. Venezuela has become a conduit for the drug trade, with the involvement of segments of the security forces.

Mr Chávez’s supreme political achievement was that many ordinary Venezuelans credited him with the handouts and did not blame him for the blemishes. They saw him as one of them, as being on their side. His supporters, especially women, would say: “This man was sent by God to help the poor”. He had llanero wit and charm, and an instinctive sense of political opportunity. He deployed these talents each Sunday on “Aló Presidente”, his interminable talk show. He had the skills of a televangelist, as Cristina Marcano and Alberto Barrera, two Venezuelan writers, put it in a revealing biography.

Abroad, Mr Chávez deployed Venezuela’s oil wealth to build an anti-American block he called the Bolivarian Alliance for the Americas (Alba). As well as Cuba, this included Bolivia and Ecuador, where far-left leaders were elected in the mid-2000s and several small client states in Central America and the Caribbean. For years he maintained a barely veiled alliance with Colombia’s FARC guerrillas, allowing them to use Venezuela as a base.

Argentina’s Cristina Fernández and her husband and predecessor, Néstor Kirchner, were semi-detached friends and clients. Venezuela bought Argentine bonds and in 2007 an alert customs official in Buenos Aires opened a suitcase stuffed with $800,000 in cash that was, its Venezuelan owner later confessed, a donation to Ms Fernández’s election campaign.

Alba was inimical to Brazil’s ambitions to lead South America. But Brazil’s left-wing presidents, while governing as moderate social-democrats, found it useful to indulge Mr Chávez. They appeared to see him as a means to blunt US influence in the region, while his economic mismanagement gave Brazilian business the chance to supply the goods and services that Venezuela ceased to produce.

Further afield, Mr Chávez delighted in embracing the world’s autocrats and dictators. He forged an alliance with Iran, which offered opaque “technical co-operation”. He agreed to buy arms worth some $15 billion, mainly from Vladimir Putin’s Russia. He made friends with Saddam Hussein, Robert Mugabe, Muammar Qaddafi and Bashar Assad. In Latin America Mr Chávez’s influence declined after 2006. Economic growth made the region’s voters less angry; and many Latin American left-wingers came to realise that chavismo was a blind alley. Though poverty fell fast in Venezuela, so it did elsewhere as the commodity boom lifted the region (see chart 2). Some on the left had always been critical. Carlos Fuentes, a Mexican writer, dubbed Mr Chávez a “tropical Mussolini”. The 2008-09 world economic slowdown exposed the weaknesses of chavismo. While much of the rest of Latin America recovered quickly, Venezuela remained in recession for two years (see chart 3).

Subordinates without a chief The Bolivarian revolution now faces its greatest test. Without doubt, chavismo will outlive its founder. Many ordinary Venezuelans will look back on his rule with fondness. But his heirs will have to grapple with some intractable problems. After a pre-election spending binge last year, the economy is slowing again. Faced with shortages of many goods, including hard currency, Mr Maduro devalued the currency by 32% in February. Venezuela comes towards the bottom of just about every league table for good governance or economic competitiveness. For 14 years Venezuelans have been told that their problems were caused by somebody else—the United States or “the oligarchy”. Getting ahead has depended on political loyalty rather than merit. The mass enrolment of millions in “universities” that mainly impart propaganda have raised expectations that are almost bound to be dashed. Assuming the PSUV wins the election, it will be ill-equipped to grapple with these problems. None of its leaders has the authority of Mr Chávez, nor his skill at communicating with the masses. While affable, Mr Maduro is a yes-man lacking political weight, according to a former Latin American foreign minister who dealt with him. Diosdado Cabello, the speaker of the National Assembly and an army colleague of Mr Chávez, has declared his support for Mr Maduro, but has ambitions of his own. Perhaps only the Cuban leadership can preserve unity among the chavistas. The stakes are high. Cuba’s president, Raúl Castro, knows that the loss of Venezuelan oil would plunge his country’s economy deeper into penury.

A majority of Venezuelans may eventually come to see that Mr Chávez squandered an extraordinary opportunity for his country, to use an unprecedented oil boom to equip it with world-class infrastructure and to provide the best education and health services money can buy. But this lesson will come the hard way, and there is no guarantee that it will be learned.