Revolutionary Cuban leader Fidel Castro dies at 90

Iconic Cuban leader Fidel Castro has died at the age of 90, Cuban state television announced, ending an era for the country and Latin America.

The revolutionary icon, one of the world's best-known and most controversial leaders, survived countless US assassination attempts and premature obituaries, but in the end proved mortal and died late on Friday night after suffering a long battle with illness.

Guerrilla revolutionary and communist idol, Castro was a holdout against history who turned tiny Cuba into a thorn in the paw of the "mighty, capitalist" United States.

The announcement of Castro's death on Friday was long expected, given the former president's age and health problems, but when it came it was still a shock: the comandante – a figurehead for armed struggle across the developing world – was no more. It was news that friends and foes had long dreaded and yearned for respectively.

Castro's younger brother Raul, who assumed the presidency of Cuba in 2006 after Fidel suffered a near-fatal intestinal ailment, announced the revolutionary leader's death on television: ''The commander-in-chief of the Cuban revolution died at 10.29pm tonight.''

He survived long enough to see Raul negotiate an opening with the outgoing US president, Barack Obama, in December 2014, when Washington and Havana announced they would move to restore diplomatic ties for the first time since they were severed in 1961.

After outlasting nine occupants of the White House, he cautiously blessed the historic deal with his life-long enemy in a letter published after a month-long silence.

The thaw in relations was crowned when Obama visited the island earlier this year. Castro did not meet Obama and days later wrote a scathing column condemning the US president's ''honey-coated'' words and reminding Cubans of the many American efforts to overthrow and weaken the Communist government.

As in life, Castro was deeply divisive in death. The announcement of his death was greeted by thousands online with celebration and condemnation of the ''cruel dictator'' and his repressive regime.

Others mourned the passing of ''a fighter of US imperialism'' and a ''charismatic icon''.

In Miami, home to the largest diaspora of expatriate Cubans, people took to the streets celebrating his death, singing, dancing, and waving Cuban flags.

The Communist party and state apparatus has prepared for this moment since July 2006 when Castro underwent emergency intestinal surgery and ceded power to his brother, Raśl, who remains in charge.

Fidel wrote occasional columns for the party paper, Granma, and made very occasional public appearances – most recently at the 2016 Communist party congress – but otherwise kept a very low profile.

Mark on history
Despite the mixed reactions to his death, one thing all could agree on was that this extraordinary figure left his mark on history.

More than half a century ago, his guerrilla army of ''bearded ones'' replaced Fulgencio Batista's corrupt dictatorship with communist rule that challenged the US and turned the island into a cold-war crucible.

He fended off a CIA-backed invasion at the Bay of Pigs in 1961 as well as many assassination attempts. His alliance with Moscow helped trigger the Cuban Missile Crisis in 1962, a 13-day showdown with the United States that brought the world the closest it has been to nuclear war.

The US had long counted on Castro's mortality as a ''biological solution'' to communism in the Caribbean but, since officially succeeding his brother in 2008, Raśl has cemented his own authority while overseeing cautious economic reforms, and agreeing the momentous deal to restore diplomatic relations between Cuba and the US in late 2014, ending more than five decades of hostility.

By Raśl's own admission, however, Fidel is irreplaceable. By force of charisma, intellect and political cunning the lawyer-turned-guerrilla embodied the revolution. Long before his passing, however, Cubans had started to move on, with increased migration to the US and an explosion of small private businesses.

His greatest legacy is free healthcare and education, which have given Cuba some of the region's best human development statistics. But he is also responsible for the central planning blunders and stifling government controls that – along with the US embargo – have strangled the economy, leaving most Cubans scrabbling for decent food and desperate for better living standards.

The man who famously declared ''history will absolve me'' leaves a divided legacy. Older Cubans who remember brutal times under Batista tend to emphasise the revolution's accomplishments. Younger Cubans are more likely to rail against gerontocracy, repression and lost opportunity. But even they refer to Castro by the more intimate name of Fidel.

Since largely vanishing from public view he has been a spectral presence, occasionally surfacing in what became a trademark tracksuit, to urge faith in the revolution. It was a long goodbye which accustomed Cubans to his mortality.

Famed for his rumpled olive fatigues, straggly beard and the cigars he reluctantly gave up for health reasons, Fidel Castro kept a tight clamp on dissent at home while defining himself abroad with his defiance of Washington.

In the end, he essentially won the political staring game, even if the Cuban people do continue to live in poverty and the once-touted revolution he led has lost its shine.

Cheers and tears
Exiles in Florida, the heart of the diaspora which fled communist rule, are expected to celebrate. Previous false reports of Castro's death triggered cavalcades of cheering, flag-waving revellers.

Latin America's leftist leaders, in contrast, will mourn the passing of a figure who was perceived less as a communist and more as a nationalist symbol of regional pride and defiance against the gringo superpower.

Details of Fidel Castro's funeral and cremation will be announced today. It is expected to attract numerous foreign heads of state, intellectuals and artists.

( Also see: 'El Comandante': Firebrand orator, indomitable leader)