As with Che Guevara, his one-time comrade-in-arms, Fidel Castro was the man who made revolutions sexy. With his wild beard, olive-green military fatigues, darkly petulant good looks and trademark cigars, El Comandante became the anachronistically glamorous face of leftwing totalitarianism. He was Marxism-Leninism’s poster boy, a revolutionary enfant terrible and, in a cold war firmament of red stars, the most brilliant, shining – and long-lived – exemplar of recklessly unrepentant revolutionary zeal.

But behind the photogenic image, there was deadly serious intent. During the cynical, paranoid years of the post-war era, Castro brought the passion of a true believer to the ideological contest between east and west. He defied the all-powerful United States and encouraged Soviet dreams of world domination. He became a symbol of resistance and an inspirational figure to leftwing insurgents across Africa and Latin America, aiding and abetting their anti-colonial independence movements. Isolated, abused and furiously plotted against, he played the part of political underdog to perfection, an eternal martyr to the cause of global liberation.

Yet Castro was also a manipulative demagogue, an oppressor and a relentless persecutor of those who dared challenge his will. Once in power in Cuba, he brooked no opposition. Violent abuses of accepted legal standards and human rights, initially excused as a revolutionary necessity, became the regime-sustaining norm. Over more than 50 years following his successful 1959 coup d’etat, he proved remarkably inflexible, doctrinaire, choleric and long-winded. He was unwilling to learn from obvious policy mistakes that, by degrees, turned Cuba into the relatively impoverished, illiberal and closed society it still is today.

Although there were significant achievements, notably in healthcare and education, Castro’s idealistic brand of state socialism, anti-capitalist collectivism and emancipatory struggle ultimately foundered. Yet the triumph of the west’s rival neoliberal, free market model may be shortlived, too. Castro survived just long enough to witness a dawning ultra-nationalist, materialist, post-ideological counter-revolution, personified by Donald Trump. He might, with justice, say: “I told you so.”

That the “maximum leader” never gave up on his socialist beliefs, right to the bitter end, is a cause for admiration, if not approbation. In one of his most quoted remarks, Castro declared “a revolution is a struggle to the death between the future and the past”. Making what now turns out to be his final address to the Communist party’s congress in Havana in April, he admitted his day was almost done – but his mortal battle for the future was not.

“I’ll be 90 years old soon. Soon I’ll be like all the others,” Castro declared. “The time will come for all of us, but the ideas of the Cuban communists will remain as proof on this planet that, if they are worked at with fervour and dignity, they can produce the material and cultural goods that human beings need, and we need to fight without truce to obtain them.”

Castro’s epic political life story has three main aspects. One concerns Cuba’s relations with the US, its domineering northern neighbour, which definitively shaped his domestic career. From the very beginning, after Castro first became involved in politics while studying law at Havana University, his opposition to the then Cuban government brought him into conflict with American interests.

In 1952, after the US-backed dictator Fulgencio Batista led a military coup and seized power in Havana, suppressing leftwing parties, Castro found himself up against the harsh realities of American regional hegemony. The Batista regime exhibited all the deplorable qualities that were to become common among repressive governments across the central and Latin American region in the latter part of the 20th century – abusive, corrupt, undemocratic and fawning in their attitude towards their Washington enablers.

By 1953, Castro had already decided revolution was the only answer. But his now fabled raid on the Moncada army barracks failed and after serving jail time, he fled to Mexico. There he met Che Guevara and began the process that led, in 1956, to his return to Cuba, a subsequent guerrilla campaign, and in 1959, his successful overthrow of Batista.

In retrospect, the subsequent head-on collision with the US appears inevitable. But perhaps it was not at the outset. Castro’s executions of Batista supporters, his failure to implement promised land reforms and his imposition of a one-party system were not actions, when taken by themselves, that would have necessarily permanently alienated Washington.

But when, in 1960, he nationalised all US-owned businesses, the response from Washington was swift and brutal: a swingeing trade embargo that quickly morphed into the de facto international quarantining of the island and its bumptious leader. The infamous attempt to overthrow Castro – the US-financed and planned 1961 Bay of Pigs invasion by rightwing Cuban exiles – came soon after, and was followed, as was later learned, by a string of CIA assassination plots. At one point, even Castro’s cigars were targeted, the idea being to make them blow up in his face.

These failures were embarrassing, and yet rather than give Washington pause they served to intensify the US vendetta against Castro’s revolution. The grudge was pursued with varying degrees of energy in the ensuing decades, stoked in the period before the 1989 collapse of the Berlin Wall by Havana’s close ties to Moscow. After the Soviet Union’s implosion, the large numbers of Cuban boat people heading for Florida, seeking economic safe haven, posed a different type of humanitarian problem.

But still the enmity for Castro persisted. Partly it was ideological. US Republicans in particular could not bear the effrontery implicit in having a Communist-run entity on their doorstep. Partly it was politics: the generally conservative Cuban-American vote centred on Miami has become an important factor in political life, as dramatically demonstrated when Al Gore narrowly lost Florida to George W Bush in 2000, an outcome that swung the presidential election. Partly it was personal. Unable to break their destructive grip on his country, yet still vibrantly un-assassinated, Castro regularly taunted America’s leaders.

Facebook Twitter Pinterest Fidel Castro and Nelson Mandela during a visit to Mandela’s home in Houghton, Johannesburg in 2001. Photograph: Chris Kotze/Reuters

Even when, in 2014, Barack Obama finally took the plunge and, admitting that ostracism and isolation were not working, moved to re-open diplomatic relations and ease aspects of the embargo, Castro remained deeply suspicious. He questioned Obama’s sincerity and “honeyed words”. He mocked him as “Brother Obama”. And he vowed that “a ruthless blockade that has now lasted for almost 60 years” and half a century of US aggression, including the 1976 bombing of a Cuban airliner by anti-Castro exiles that killed 73 people, could not be forgotten. Not forgotten by Castro, at least, nor by some others among his revolutionary generation, for whom the old wounds have never entirely healed. The US under Obama had changed. Castro had not.

It will never be known whether, without the crushing effect of the US embargo, the Cuban revolution might eventually have flourished economically and liberalised politically. Certainly Castro felt himself under permanent siege, in an ongoing state of war, and this inescapably constricted his policy choices. As the infinitely more powerful and wealthier partner in a dysfunctional relationship, he certainly believed it was the US that bore the greater blame.

Even when Obama finally visited Havana this year, the two men did not meet. How this wary rapprochement moves from this point forward is highly uncertain given a new, unpredictable face in the White House and the continued predominance in Havana of the old guard, typified by Castro’s cautious brother, Raúl. For any other US president, Castro’s passing would be seen as a moment of immense opportunity. For a blundering, know-nothing Trump, it could be another chance to make a difficult situation worse.

Castro’s political life was also dominated to a significant degree by his relationship with America’s principal cold war adversary, the Soviet Union. He maintained at various times that US actions drove him into Moscow’s arms. But there was no denying his ideological attraction to the communist system that emerged in Russia and eastern Europe after 1945 and which was soon challenging US and British power across a developing world struggling to shrug off imperial and colonial shackles.

Soviet leaders from Nikita Khrushchev onwards were not slow to exploit Castro’s potential as a thorn in the side of their American rival. The Soviet Union poured money and assistance into Cuba, partly out of friendship but more particularly to thwart the US embargo and tweak Washington’s nose. For years Moscow guaranteed the purchase of most of the island’s vital sugar crop.

But this dependence on Russia came at a price, and the debt was collected in 1961-62 when Khrushchev and the Red Army began a secret deployment of nuclear missiles in Cuba. It was an audacious move that president Kennedy, when he became aware of it, predictably deemed an existential threat. It led directly to the so-called Cuban missile crisis, the closest the world has yet come to nuclear Armageddon.

The crisis was defused, in part by the reciprocal, secret withdrawal of US nuclear-capable missiles from Turkey. But the affair caused lasting damage to Castro’s Cuba, with even sympathetic American liberals who were opposed to the blockade appalled that he should have collaborated with such a dangerous Soviet operation. In Washington’s official view, Cuba moved from regional problem to strategic threat, a skewed perception that continued to negatively influence attitudes even after Mikhail Gorbachev pulled the plug on the Cuban economy in the late 1990s and halted Russian assistance.

This fear-filled view of Castro as international bogeyman was exacerbated by a third aspect of his political life story – his self-appointed role as a prime exporter of revolution, unbending champion of the oppressed and bold advocate for the countries of the developing world. Despite his ties to Moscow, Castro assumed a prominent role within the Non-Aligned Movement. He espoused the cause of the African National Congress in South Africa in fighting apartheid and seeking to achieve majority rule, and became a close friend of the country’s first black president, Nelson Mandela.

His support was practical as well symbolic. Despite Cuba’s severe economic problems, Castro sent many troops and civilians, notably doctors, to Angola and Mozambique to assist self-styled liberation forces that were also supported by Moscow. In his first intervention in Angola in 1975, Castro provided vital help to leftwing guerrillas of the People’s Movement for the Liberation of Angola, in opposition to US-backed South African forces and Jonas Savimbi’s notorious National Union for the Total Independence of Angola (Unita).

Facebook Twitter Pinterest Fidel Castro cuts sugar cane in Cuba in 1961. Photograph: AP

Castro also proved an inspirational figure for leftwing liberation movements and would-be revolutionaries across central and Latin America. His ideological example may be said to have paved the way for the so-called “red tide” of leftist democratic electoral triumphs that characterised the early part of this century across the continent.

In 1980s Nicaragua, scene of an undeclared dirty war between the Contra rebels illegally backed by the Reagan administration and the Sandinista Front led by Daniel Ortega, and likewise in El Salvador and Panama, Castro helped provide a counterweight to American efforts, both direct and indirect, to prop up or install conservative, pro-Washington regimes.

In his later years, even as he slipped out of public view, the story remained more or less the same. Hugo Chávez, author of the Bolivarian revolution in Venezuela, like other leftwing leaders in Bolivia and Ecuador, found in Castro a role model whom he repaid with cheap oil and political support. When Chávez became ill, it was to Cuba that he turned for medical treatment – a remarkable testimony to what a poor country under extreme sanction by a superpower can achieve against all the odds. When Colombia’s government sought to end its long-running conflict with leftwing Farc rebels, it was to Havana that it turned as a venue for peace talks.

In a sense, Castro’s entire life’s work may be summed up in this way: agree with his views or not, condone his methods or fiercely dispute them, he fought indefatigably against tremendous odds throughout his political life – and in so doing achieved an astonishing degree of influence across the globe. Maybe his legacy will stand the test of time, as he claimed at April’s congress, or maybe not. But for the most part, Castro, iconic hero of the left, was on the right side of history.

CASTRO’S LIFE