Venezuelan President Hugo Chávez Frias, who died on Tuesday, from cancer, at the age of fifty-eight, was one of the most flamboyantly provocative leaders on the world scene in recent years. His death came after months in which his health was a national mystery, the subject of obfuscation and rumors; he spent inauguration day for his fourth term in a hospital bed in Cuba. Vice-President Nicolás Maduro, who made the announcement, is one of the politicians now maneuvering to control Venezuela, where elections will be held within thirty days.

A one-time army paratrooper who served two years in prison after leading a botched military coup against Venezuela’s government in 1992, Chávez emerged from behind bars, after an amnesty, with a renewed determination to achieve power, and sought the support of Cuba’s veteran Communist leader Fidel Castro to do so. In 1998, Chávez won Venezuela’s Presidential elections, promising to change things in his country forever, from top to bottom. Since the day he was first sworn in as President, in February, 1999, he devoted himself to doing precisely that. What he has left is a country that, in some ways, will never be the same, and which, in other ways, is the same Venezuela as ever: one of the world’s most oil-rich but socially unequal countries, with a large number of its citizens living in some of Latin America’s most violent slums.

To his credit, Chávez was devoted to trying to change the lives of the poor, who were his greatest and most fervent constituents. He began by hammering through a new constitution and renaming the country. Simon Bolívar, who had fought to unite Latin America under his rule, was Chávez’s hero, and so he changed the country’s name to the Bolivarian Republic of Venezuela, and thereafter spent a great deal of time and resources attempting to forge what he called his “Boliviarian Revolution.” It was not, initially, to be a socialist or even necessarily anti-American endeavor, but over the following years Chávez’s rule, and his adopted international role, became both, at least in intention.

I met Chávez a number of times over the years, but the first time I saw him was in 1999, shortly after he had become Venezuela’s President, in Havana, Cuba, giving a speech in a salon at the University. Both Castro brothers were in attendance—a rare sight—as were other senior members of the Cuban Politburo. Fidel Castro looked on and listened raptly as Chávez spoke for ninety minutes, essentially laying out the rhetorical groundwork for the intense and deep relationship between the two countries, and the two leaders, that was soon to follow. That day, a number of observers present in the room commented on what appeared to be a major bromance between the two. They were right. Chávez, younger than Fidel by nearly thirty years, soon became inseparable from the Cuban leader, who was clearly a father figure and a role model. (His own father, Hugo de los Reyes Chávez, and his mother, Elena Chávez Frías, were poor primary-school teachers in the Venezuelan interior. Hugo was the second of six sons, and joined the Army when he was seventeen.) And for Castro, Chávez was an heir and something like a beloved son. Uncannily, or fittingly, it was Fidel who noticed Chávez’s discomfort on a visit to Havana in 2011, and insisted that he see a doctor—who promptly discovered Chávez’s cancer, a tumor described as the size of a baseball somewhere in his groin area. Since then, and until he returned home in February, terminally ill, Chávez received virtually all of his cancer treatment in Havana, under Fidel’s close scrutiny.

A warm and amiable showman, with a remarkable sense of occasion as well as strategic opportunity, Chávez grew in ambition, and global stature, during the Bush years, in which Latin America was relegated to a back burner for Washington. Chávez was alienated early on by the bellicose rhetoric of the Bush Administration in the post-9/11 period, and became increasingly acerbic about policies and attitudes of the American “empire.” He delightedly ridiculed the U.S. President he called “Mister Danger” and “Donkey” and whom he regularly mocked on his weekly television show, “Aló Presidente,” on which he sometimes made governing seem like reality television. (He once ordered his Defense Minister to send Venezuelan forces to the Colombian border live on “Aló Presidente.”)

An attempted coup d’etat by a cabal of right-wing politicians, businessman, and military men in 2002 saw Chávez briefly and humiliatingly detained, before he was freed and allowed to resume office. The coup against Chávez had failed, but not before the plotters had apparently received a wink and a nod from the Bush Administration. Chávez never forgave the Americans. Thereafter, his anti-American rhetoric became more heated, and whenever possible he sought to discomfit Washington. Chávez closed U.S. military liaison offices in Venezuela, and ended coöperation with the Drug Enforcement Administration. Even earlier, in 2000, Chávez had flown to Baghdad for a friendly visit with Saddam Hussein. Later on, in his avowed ambition to weaken the U.S. imperio and create a “multipolar world,” he would go on to embrace others with similarly anti-American stances: Iran’s Ahmadinejad was one, Belarus’s Lukashenko was another. He invited Vladimir Putin to send his Navy to do exercises in Venezuelan waters, and to sell him weapons. And there was his increasingly chummy, and dependent, relationship with Fidel Castro.

Venezuelan oil was flowing to energy-strapped Cuba, effectively ending the country’s almost decadelong penurious “Special Period” that followed the Soviet collapse and the abrupt end of three decades of generous subsidies from Moscow. Cuban doctors, sports instructors, and security men were soon travelling in the other direction, helping Chávez by staffing some of the programs he called Misiones, aimed at alleviating poverty and disease in Venezuela’s slums and rural hinterlands. Chávez and Castro took trips together, and frequently visited one another’s countries, and it was obvious that they loved one another’s company.

On a visit to Caracas in 2005, shortly after Chávez had announced that he had decided that socialism was the way forward for his revolution and for Venzuela, I saw him in the Presidential palace. He was manic with newfound revolutionary fervor. In a meeting with poor peasant farmers, he announced the seizure of several large private landholdings in the interior, and instructed them euphorically to organize themselves into collectives and farm the confiscated farms. “R.A.S.!,” he shouted happily, repeating it several times. “R.A.S.!” An aide explained that the acronym meant rumbo al socialismo—“onward to socialism.” It never really panned out, though. Chávez’s attempts at collectivization and agrarian reform seemed ill-planned and out-of-time, somehow, much as he himself often seemed a throwback to earlier times, when Latin America was dominated by willful caudillos, and there was a Cold War with a world clearly polarized.

A couple of years later, I asked him why, so late in the day, he had decided to adopt socialism. He acknowledged that he had come to it late, long after most of the world had abandoned it, but said that it had clicked for him after he had read Victor Hugo’s epic novel “Les Misérables.” That, and listening to Fidel.