The bearded and ferocious Fidel Castro ruled Cuba unchallenged for nearly half a century, hated by the United States - whose secret service more than once tried to assassinate him - and was at the centre of the Cuban missile crisis which brought the US and the Soviet Union to the very brink of nuclear war.
The world held its breath for 12 unbearably tense days in October 1962 after President John F Kennedy discovered that Kremlin leader Nikita Khruschev was placing nuclear missile installations on the island, just 90 miles from Florida.
The crisis - probably the most perilous time of the entire Cold War - was abated only when Khruschev backed down and said the installations would be dismantled.
When Castro, and his Marxist revolutionary friends, seized power in 1959, he proceeded to nationalise all American property, leading to relentless hostility towards him from the United States.
The CIA tried all manner of ways to assassinate him, including a bizarre exploding cigar, designed to detonate when Castro puffed on it, and booby-trapped seashells in spots where he used to enjoy diving.
In 1961, US-backed Cuban exiles tried to invade the island at the Bay of Pigs, but forces led by Castro successfully fought them off.
Meanwhile, the Cuban economy was being propped up by the Soviet Union - a further source of friction between Cuba and the United States - with the Kremlin purchasing vast amounts of sugar and supplying Castro with economic and military aid.
But the collapse of communism and the destruction of the USSR reduced Cuba to a dire economic state and left Castro a diminished international figure.
Even so, he remained unchallenged. But in July 2006, ill health caused him to delegate virtually all his duties to his brother, Raul Castro.
This transfer was supposed to be temporary while Fidel recovered from surgery for "an acute intestinal crisis with sustained bleeding". By then, Fidel was physically frail and infirm. Raul officially took power as first secretary in 2008.
Fidel Castro was born on August 13 1926, attending Catholic schools before graduating from the University of Havana with a degree in law.
Two years later, he ran for election to the Cuban House of Representatives, but the elections were halted by the then dictator Fulgencio Batista.
As a result an enraged Castro assembled a small force and attacked the Moncada army barracks in Santiago de Cuba in 1953.
It failed and most of his supporters were killed or captured. Castro was himself captured and sentenced to 15 years in prison, but he was pardoned after just two years.
It was during his trial that Castro delivered his famous "History will absolve me" speech.
In it he said: "I warn you, I am just beginning! If there is in your hearts a vestige of love for your country, love for humanity, love for justice, listen carefully.
"I know that the regime will try to suppress the truth by all possible means. I know that there will be a conspiracy to bury me in oblivion. But my voice will not be stifled - it will rise from my breast even when I feel most alone, and my heart will give it all the fire that callous cowards deny it.
"Condemn me. It does not matter. History will absolve me."
Castro went into exile in Mexico where he trained a group of revolutionaries called the 26th of July Movement. In December 1956, his forces, supported by Che Guevara and others, invaded Cuba from the ship Gramma, but suffered serious losses.
However, the revolutionaries hid in the Sierra Maestra mountains, gaining support among the peasants. Eventually, on January 1 1959, Batista fled the island and Castro assumed power.
Relations with the US declined rapidly. In 1960, Castro took over the US oil refineries in Cuba and the Americans stopped buying Cuban sugar.
He responded by taking over all US businesses in Cuba, and a furious President Kennedy responded with the CIA-bankrolled Bay of Pigs invasion attempt.
Various theories have been put forward for the failure of this operation. One was that Kennedy, at the last minute, mysteriously withdrew essential air support, and another was that the president had gravely under-estimated the scale of support for the Marxist Castro among the Cuban people.
Castro feared another US attack, and so when Khruschev offered to place nuclear missiles on the island, he agreed.
This brought Kennedy and Khruschev into face-to-face snarling conflict, until Khruschev backed down.
Castro, who was no more than a pawn in this dangerous international conflict, felt let down by the USSR, which nevertheless continued to prop up the island's otherwise dire economy.
Despite this setback, and later the even more damaging effect of the collapse of the Soviet Union, Castro's omnipotence over Cuba remained undisputed.
During his years in power he reputedly amassed a huge fortune, although he fiercely denied it.
The US business and financial magazine Forbes in 2005 listed Castro among the world's richest people with an estimated net fortune worth 550 million US dollars. Later, the magazine increased the estimates to 906 million US dollars, amid rumours of large cash stashes in Switzerland.
Castro himself described these reports as "lies and slander" and said they were part of a US smear campaign to discredit him.
He vowed: "If they can prove I have a bank account abroad with 900 million dollars, with 1 million dollars, 500,000 dollars, 100,000 dollars or 1 dollar in it I will resign."
It was claimed by his supporters that money from state-owned companies was pumped back into the island's economy and not into Castro's wallet as was suspected by his enemies.
Indeed, Castro did much to improve education and health services and other social services on the island.
The various assassination attempts were straight from the pages of James Bond. These included an attempt to smuggle a jar of cold cream containing pills into his room, the exploding cigar, a fungal-infected scuba-diving suit and a mafia-style shooting.
Some of these plots were depicted in a documentary entitled 638 Ways To Kill Castro. He once said in regard to the myriad failed attempts on his life: "If surviving assassination attempts were an Olympic event, I would win a gold medal."
It was in January 2004 that question marks appeared over Castro's health, with speculation that he had once had a heart attack, that he had suffered from cancer and that he had neurological problems. None of this speculation was confirmed.
In October of that year, he tripped and fell in front of TV cameras following a speech he gave at a rally. He broke a kneecap and fractured his right arm, but was able to recover his ability to walk.
His subsequent illnesses were to transform the strong and strident man of Cuba into a mere physical shadow. But he lost none of his zeal.
In April 2016, ahead of his 90th birthday the following August, he gave a speech to the Cuban Communist Party faithful, saying: "Soon I'll be like all the others.
"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."
His brother Raul Castro, the president of Cuba, announced his death on state television late on Friday in Cuba.