Hugo Chavez died this week in Venezuela at the age of 58, but his battle with a never-specified form of cancer was waged largely in a Cuban hospital - a telling detail, as Cuba loomed just as large in his political imagination as his native country.

It's a point that my gringo friends up north always struggle with. The Cuban Revolution's immense influence on the region has been constantly underestimated and misunderstood from day one. It's only a slight exaggeration to suggest that everything of note that's happened south of the Rio Grande since 1959 has been an attempt either to emulate, prevent, or transcend the Cuban experience. Chavez will be remembered as the most successful of Fidel Castro's emulators, the man who breathed new life into the old revolutionary dream.

Starting in the 1960s, guerrilla movements throughout the hemisphere tried to replicate the Sierra Maestra rebels' road to power, to no avail. In the 70s, Chile's Salvador Allende tried the electoral route, but he didn't have a clear majority. In the 80s, Nicaragua's Sandinistas had the majority and rode it to power, but took over a state too bankrupt to implement the social reforms they'd always championed.

Chavez had all three things - power, votes, and money - plus charisma to boot. His was the last, best shot at reinventing Caribbean Communism for the 21st century.

At the root of the extraordinarily close alliance Chavez built with Cuba was a deep, paternal bond between two men. A fiercely independent figure, the messianic Chavez was never seen to kowtow to anyone. But there were special rules for Fidel.

Chavez's extraordinary devotion sprung from Castro's status as the mythical Hero-Founder of Latin America's post-war hard left. Chavez loved to brag of his frequent, spur-of-the-moment trips to Havana to seek Castro counsel. When he was diagnosed with the cancer that ultimately killed him, Chavez got invites from high-tech medical centres in Brazil and in Spain, but it was never in doubt where he would seek treatment. Chavez trusted Fidel, literally, with his life.

There's no comparable relationship between two leaders in contemporary world politics, and it had its political consequences - especially for Chavez.

In a Cold War throwback, his government welcomed tens of thousands of Cuban doctors, trainers, and "advisers" - including an unknowable number of spies - to Venezuela. And tens of billions of petrodollars flowed in the opposite direction, a resource stream that propped up the last bastion of totalitarianism in the Western Hemisphere long past its sell-by date. For Fidel, who had had his eyes on Venezuela's oil riches since the 1960s, Chavez's election was an unbelievable stroke of luck.

Much has been written about the way Venezuela stepped in to fill the fiscal and strategic void the collapse of the Soviet Union left in Cuba, but the reality is much stranger than that. As the unquestionably senior member of their Cold War alliance, the Soviets treated Cuba as just another satellite state; Fidel's subjugation to a Cold War superpower was always something of an embarrassment to him.

In the Caracas-Havana axis, by contrast, the paymaster doubled up as the vassal. Venezuela effectively wrote a fat petrocheck month after month for the privilege of being tutelaged by a poorer, weaker foreign power.

The extent of this reverse colonisation was startling. Cuban flags eventually came to flutter above Venezuelan military bases and Venezuelans witnessed the surreal spectacle of a democratically elected president telling them that Venezuela and Cuba share "a single government" and that Venezuela "has two presidents". Cuban military advisers kept watch over Venezuela's entire security apparatus, and had exclusive control over Chavez's personal security detail. Through most of his 20-month battle with cancer, the Castros had better information about the president's condition than even his inner circle back home, and they manoeuvred successfully to ensure a pro-Havana diehard, Nicol aacs Maduro, won the tough battle for succession.

Chavez imported more than just personnel and advice; he imported the Cuban Revolution's eschatology virtually whole. Fidel's vision of revolution as a kind of cosmic morality play pitting unalloyed socialist "good" in an unending death struggle against the ravages of "evil" American imperialism became the guiding principle of Venezuela's revolution.

The use and abuse of anti-imperialist rhetoric as a mechanism for consolidating authoritarian control over society was the most valuable lesson Chavez learned from Fidel. A superheated brand of unthinking anti-Americanism became the all-purpose excuse for any and every authoritarian excess, stigmatising any form of protest and casting a dark pall over any expression of discontent or dissent. The technique's infinite versatility proved its central attraction: You could blame shadowy gringo infiltrator for neighbourhood protests over chronic power shortages just as easily as you could silence whistleblowers of government corruption by casting them as CIA fifth columns.

In Cuba, considering the island's history as a target for American imperialist meddling, anti-imperialism - however wantonly abused - rested on a bed of historic verisimilitude. But in Venezuela, a country with no history of direct American imperial aggression, this borrowed bit of rhetorical posturing served only to underline chavismo's derivative status, its ideology a kind of fidelista hand-me-down lacking even the self-awareness to realise it was decades out of date by the time it was born.

Where Chavez was able to transcend the Cuban model, it was largely due to the advantages of life at the receiving end of an unprecedented petrodollar flood. By some estimates, Venezuela sold over $1 trillion worth of oil during his tenure, and so his was government by hyperconsumption, not rationing. The petroboom allowed Chavez to substitute the chequebook for the gulag; marginalising his opponents via popular spending programs rather than rounding them up and throwing them in jail. Rather than declaring all-out war on business, he co-opted them. Rather than abolish civil society, he created a parallel civil society, complete with pro-government unions, universities, radio stations and community councils. Such enhancements were tried before by left-wing populists in Latin America, but always failed because they ran out of money.

Chavez avoided this pitfall thanks to the greatest of his innovations: He consciously avoided a complete break with the US of the kind that Castro provoked in 1960. Instead, he railed against gringo imperialism all morning, then spent all afternoon selling those same gringos oil. The irony is that this, his most important innovation, will be the one least memorialised by his admirers. It was a gloriously incoherent posture, but one that fit the square peg of revolutionary zeal into the round hole of an import-led petropopulism.

Ironically, though, in its dependence on oil rents, the Chavez model quietly undermined its own claim to represent a new alternative to dreaded Washington-sponsored neoliberalism. After all, if Venezuela could afford to botch the nationalisation of its own steel industry, it was because there were always petrodollars around to import the steel that local industry was no longer producing. And if nationalisations up and down the agro-food chain resulted in food shortages, money could always be found to import the balance. As the Venezuelan State-Owned Enterprise sector grew, it looked more and more like the USSR's - with a single profit-generating industry cross-subsidising a bewildering array of loss-making concerns. Chavenomics, as a development model, boiled down to little beyond extracting oil, selling it at high prices, and using the proceeds to paper over the rest of the system's cracks. How such a model is supposed to be relevant to countries that don't happen to float on top of hundreds of billions of barrels in oil reserves is anybody's guess.

Still and all, petropopulism's attractions were all too clear for Chavez. Those deep, oil-lined pockets allowed Chavez a luxury Fidel could only dream of: being able to hold a long string of not-overtly-rigged elections without ever seriously endangering his grip on power. It used to be that you could have either unchecked personal power or electoral legitimacy, but the petrodollar flood allowed Chavez to have both.

Elected autocracy may sound like an oxymoron, but this is exactly what the Venezuelan synthesis of the Cuban experience yielded: a system that washed away the sins of its own aggressive contempt for dissidence and dissent through continual recourse to the ballot box. What Hugo Chavez built was, in other words, a flawless autocracy.

Francisco Toro is a Venezuelan journalist and co-author of Blogging the Revolution: Caracas Chronicles and the Hugo Chavez Era.