On 11 February 1981, President Ronald Reagan wrote in his diary that "intelligence reports say Castro is very worried about me . . . I'm very worried that we can't come up with something to justify his worrying." Reagan's concern has been the concern of all US presidents since Fidel Castro took power in Cuba in 1959, and set about establishing a communist state just 90 miles across the water from Miami. In response to the emergence of Castro, the US sent the CIA in to Cuba and put in place a trade embargo. So began one of the longest political stalemates of modern history.

It is remarkable today how little between the two countries has changed - as recent events remind us. First, Juanita Castro, the estranged sister of Fidel and Raúl, revealed that she herself had been a CIA spy before fleeing to Mexico in 1964. Then, on 28 October, the UN General Assembly in New York took its 18th consecutive annual vote to highlight international opposition to the US embargo, a vote that Washington chose once again to ignore. Some suspected that Juanita's revelations may have been timed to influence the vote, because it was feared that President Obama's promise to extend the hand of friendship to America's old enemies might make him the first US president to change policy on Cuba.

For now, that seems unlikely. But if Cuban relations with the US finally begin to thaw during the Obama presidency, Fidel Castro - if he lives to see it - will have overcome every US attempt to destroy him.

When Juanita defected in 1964, she took 21 suitcases with her. It is unlikely she would have had so many to take today. Fifty years of sanctions have impoverished Cuba, a country that under the acting president, Raúl Castro, remains defiantly socialist 20 years after the fall of the Berlin Wall. A half-century of Fidel Castro's personal rule has left a profound mark. It was in 1953 that Fidel Castro - a 26-year-old lawyer from a landowning family - first came to the wider attention of the island his revolution would later engulf. Stalin had just died and the first colour television sets were about to go on sale in the US. On 26 July he masterminded an attack on the Moncada Barracks, one of the military installations of the dictator Fulgencio Batista, situated in Castro's home town of Santiago de Cuba.

The attack failed, but Cubans were astounded by the audacity of what amounted to an attempted coup carried out by men with pea-shooter rifles and mock military uniforms. Castro's final speech to the court, before being sentenced to 15 years in prison for his part in the failed coup, was to become his working political platform: a programme of economic and social empowerment, threaded into the historical struggle of Cubans for independence from foreign powers.

With the speech worked up under the title of its ringing final line - "Condemn me, it does not matter, history will absolve me!" - it is the sentiment as much as the substance of this document that has been the most consistent element of Castro's political philosophy since he came to power in 1959.

As peritonitis forced him to hand the presidency to his brother Raúl in February 2008, Fidel Castro, who is 83, is no longer his country's official leader. But little of substance is decided in Cuba without his being consulted and he remains the most controversial politician in postwar Latin America, the inspiration if not the figurehead for a new wave of leftist Latin leaders: Lula in Brazil, the Kirchners in Argentina, Tabaré Vázquez in Uruguay and Evo Morales in Bolivia. Loathed by many but adored by many more, Castro has embodied more than any other George Bernard Shaw's maxim that "the secret to success is to offend the greatest number of people". He has survived more than 600 assassination attempts

by the CIA to become the consummate world symbol of anti-capitalism.

“President of the Council of State, President of the Council of Ministers, Commander-in-Chief of the Army and First Secretary of the Communist Party of Cuba" - Castro's full title at the height of his authority reveals the full sweep of his powers. A modern version of the 19th-century caudillo, he has ruled his country "like a large family", as one biographer generously puts it. In reality, Cuba is a country that, like his own family, has endured painful splits on his behalf.

Castro has long attempted to keep his personal and political lives distinct. He met his second wife, Dalia Soto del Valle, in 1961, but Cubans have heard little of her since; they live in a secured enclave outside Havana. What Cubans have heard about, like the rest of the world, is the literacy campaign Castro was working on when he met her. This campaign is perhaps Castro's greatest single achievement, representing the very best that the Cuban Revolution could achieve: the revolt was always a social movement far broader than simply guerrilleros with beards and green fatigues.

This and other large-scale social programmes, such as urban reforms to boost home ownership in the cities, and land redistribution in the countryside, for a while made the Cuban Revolution, and Castro with it, the inspiration of the European and American left. In 1960, Allen Ginsberg welcomed Castro to New York in a springy-haired embrace. The same year, Jean-Paul Sartre and Simone de Beauvoir visited Cuba to witness the change. "For the first time we were witnessing happiness that had been attained by violence," they declared.

Such is the paradox of Castro, however, that just as his literacy campaign was being rolled out across the country, a film showing Cubans out on the town in Havana prompted the imposition of severe state censorship. Castro's Words to the Intellectuals were delivered in the summer of 1961 in the auditorium of the national library, which was decked out more like a courtroom than a place of scholarship. That day Castro set out a formula which has been used ever since to censor writers and intellectuals: "Within the revolution everything. Without the revolution, nothing."

The revolution continued to harden throughout the early 1960s, as a more stringent party line was established in workplaces and Committees for the Defence of the Revolution were set up to report on "unrevolutionary" behaviour. As a result, many western intellectuals (including Sartre and de Beauvoir) rejected the Cuban Revolution. Castro argued then, and has continued to do so, that they turned away because they did not understand the reality of Cuba or of Cubans, just as they did not understand Latin America in general. Castro, by contrast, has always believed that he has an inimitable capacity for understanding his people. For him, telling the Cuban intellectuals what to write was no different from teaching the peasants how to read: both were useful to the extent they served society.

The Colombian writer Gabriel García Márquez, winner of the Nobel Prize for Literature in 1982, has written of his friend Castro's "love of the word" as being one of his most noble characteristics. But Márquez is nearer to the truth when he says that "one thing is certain: wherever he may be, however and with whomever, Fidel Castro is there to win". For Castro, words are weapons, "arrows stuck in the rough hide of reality", as Susan Sontag put it. And he is invariably careful to match his words with actions. When, during a speech in 1960, Castro revoked the Mutual Aid Treaty signed between Cuba and the US in 1952, he literally tore up the treaty in front of a crowd. A careful strategist as much as he is a performer, he did so safe in the knowledge that by then US-Cuban relations were broken beyond repair.

Castro went on to expropriate nearly all US-owned land and utilities in Cuba, precipitating the disastrous backlash overseen by John F Kennedy at the Bay of Pigs in 1961, when more than 1,000 CIA-trained mercenary troops (exiled Cubans) were defeated by the Cuban army. The Bay of Pigs debacle was also prompted by Kennedy's fears that Cuba was becoming a communist state in America's own backyard. But it was not yet obvious - least of all to the Soviet leader Nikita Khrushchev - that Castro would make his revolution along Soviet lines.

In fact, the great problem shaping the revolution in the early 1960s was that Cuba's relations with the US were severed before Castro had the full support of the Soviet Union. This became painfully clear to the Cubans in the resolution to the missile crisis of October 1962 when Khrushchev and Kennedy agreed on peace terms that Castro believed left Cuba's independence compromised. In the months that followed, Castro challenged Khrushchev in a way no other socialist leader would have done.

Over the following years his attempts to smuggle arms to myriad guerrilla movements in Latin America (he even provided secret training camps for them in the Cuban countryside) further antagonised the Soviets because of the way that it appeared - at the time of the Sino-Soviet split - to follow the approach of Chairman Mao more than Khrushchev.

It took the west even longer than Khrushchev to understand that Castro rejected Cuba's position as a Soviet client state. From the beginning of the revolution, he envisaged Cuba as an independent nation before it was a part of the communist fraternity. His vision (like that of Che Guevara) was of a solidarity of the small, of alliances with other would-be revolutionary nations. He exercised this directly with Algeria before the overthrow of that country's leftist leader Ahmed Ben Bella in 1965, and again in 1975 when he sent troops to the newly independent Angola, under the socialist MPLA, to help combat an invasion by the then apartheid South Africa.

Unlike most other revolutionary leaders, Castro has been able to adapt and reinvent himself to suit different circumstances. He led his country through a kind of perestroika avant la lettre in the 1980s. In 1995, at the height of the economic troubles that befell Cuba after the break-up of the Soviet Union, he appeared at the UN General Assembly wearing a dark suit and tie rather than the military fatigues of the previous three decades. It was the clearest possible statement that Cuba was now open to the world for business.

Yet Castro has never relinquished his commitment to revolutionary internationalism. By the mid-1980s, he had begun exporting doctors and health professionals around the world, particularly to beleaguered countries such as Haiti, East Timor and black South Africa. Today there are still more than 40,000 Cuban medical personnel working in different countries, more than the G8 countries combined provide. The greatest number of them work in Venezuela, where, since 2005, President Hugo Chávez has returned the favour by providing Cuba with oil.

The Castro-Chávez axis is undoubtedly Cuba's most important international alliance. Chávez allows Castro to keep the socialist flame alight in Cuba. Since the fall of Soviet communism, Castro's refusal to abide more fully by the rules of the international system has frustrated western leaders who have quietly hoped that Cuba would go the route of Vietnam and implement a form of soft socialism with markets. Today, the global

financial crisis puts a different spin on Cuba's commitment to a fully socialist economy: even the London-based New Economics Foundation recognises Cuba as an example of how to survive through the "triple-crunch" of credit, climate and energy crises.

The country is obviously no socialist utopia. Through the long years since the revolution, the disaffected have attempted to escape across the Florida Straits to the US. In 1980, around 125,000 Cubans took to the waters from the Cuban port of Mariel, when, angered by Jimmy Carter's attempt to encourage asylum-seekers at Havana's embassies, Fidel opened the exit for five months, ensuring that anyone he didn't want around had every opportunity to use it.

So, Castro has survived because of his ruthlessness. But perhaps the greater reason for his survival is the sheer adversity that Cuba has had to confront and Castro's efforts to overcome it. We all know about the damage that Hurricane Katrina inflicted on the southern United States in 2005; but the three storms that ripped through Cuba last summer caused an estimated $10bn of damage, yet have been largely forgotten by the wider world. Castro has responded effectively to such disasters, in stark contrast to the way that George W Bush reacted to Hurricane Katrina, for example. In addition, Cubans under Castro have rid their island of many infectious diseases, avoided the development of the slums that have blighted cities across mainland Latin America and - for all its flaws - have entrenched an active network of participatory organisations.

Seeking over the years to go even further than this, Castro has unleashed a veritable plague of schemes on his people. Among his most ambitious projects were his plans, soon after coming to power, to drain the swamps of Ciénaga de Zapata on the southern coast and turn them into prime agricultural land. In that instance, his careful investigation of the scheme afforded him an acute understanding of the area where the Bay of Pigs invasion took place, and was one reason for the subsequent Cuban victory there.

But perhaps Cuba's most unlikely achievement has also grown out of another Castro obsession: a world-renowned biotechnology industry that has so far produced vaccines against Hepatitis B, meningitis and certain forms of cancer, and continues to work on developing an effective HIV vaccine.

These realities undermine a common misrepresentation of Castro's rule as unchanging and absolute. This is how he has long been portrayed by his supporters and enemies alike. Cuban exiles in Miami concentrate on the cult of Castro's personality, in the hope that 50 years of Cuban socialism will be erased at the same time as Fidel, while those defending the revolution from Havana like to portray the leaders and party members as the sole agents of change. Little is said about how Castro's grip on power has, at times, been under significant domestic pressure. This was most spectacularly witnessed in 1994, when he was forced to appear before crowds that had begun to riot in the poorest districts of Centro Habana. But what is misunderstood, too, is just how popular Cuba's variant of socialism is among ordinary Cubans.

If Fidel Castro is one of modern history's great political survivors, it is an achievement that he must ultimately share with his people. Because of him and the revolution, they enjoy substantial rights to health and education, a vibrant culture and remarkably solid communities. But thanks also to Castro, they have been given very little room to breathe outside the officially sanctioned life.

As for Castro himself, the aged and ailing guerrilla fights on. He has a new slogan, too: “A better world is possible." Time will tell if the terms of that world are something that he, his brother Raúl and Barack Obama will be able to agree on.

Simon Reid-Henry is director of the Centre for Global Security and Development at Queen Mary, University of London, and the author of "Fidel and Che: a Revolutionary Friendship", published by Sceptre (£8.99)

Click here for a timeline of Fidel's defining moments.