Cuba has declared nine days of national mourning to mark the death of Fidel Castro, whose demise at the age of 90 has prompted emotional scenes in Havana and Miami, tributes and reflections from world leaders, and ushered the island into an uncertain era.

Fidel Castro: world reacts to death of Cuban leader – live updates

Read more

The US president, Barack Obama – who two years ago brokered a deal to restore diplomatic ties between Washington and Havana for the first time since they were severed in 1961 – offered his condolences and said the thoughts and prayers of the US were with the Cuban people.

“We know that this moment fills Cubans – in Cuba and in the United States – with powerful emotions, recalling the countless ways in which Fidel Castro altered the course of individual lives, families, and of the Cuban nation,” he said. “History will record and judge the enormous impact of this singular figure on the people and world around him.”

He urged Cubans to remember that they had “a friend and partner in the United States of America”.

The US president-elect, Donald Trump, referred to Castro as a “brutal dictator” who had oppressed his people for nearly six decades.

“Fidel Castro’s legacy is one of firing squads, theft, unimaginable suffering, poverty and the denial of fundamental human rights,” he said. “While Cuba remains a totalitarian island, it is my hope that today marks a move away from the horrors endured for too long, and toward a future in which the wonderful Cuban people finally live in the freedom they so richly deserve.”

The contrasting language from Obama and his successor suggests Trump may take a less conciliatory line on the US’s recently renewed relationship with its smaller neighbour, a relationship already seen as one of the main legacies of Obama’s presidency.

Castro, 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 a long battle with illness.

Given the former president’s age and health problems, the announcement of his death had long been expected. 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, Raúl, who assumed the presidency of Cuba in 2006 after Fidel suffered a near-fatal intestinal ailment, announced the revolutionary leader’s death on television on Friday night. “With profound sadness I am appearing to inform our people and our friends across [Latin] America and the world that today, 25 November 2016, at 10.29pm, Fidel Castro, the commander-in-chief of the Cuban revolution, died,” he said. “In accordance with his wishes, his remains will be cremated.”

Raúl Castro concluded his address with the famous revolutionary slogan: “Ever onwards to victory!”

On Saturday, the Cuban government announced Castro’s ashes would be interred at the Santa Ifigenia cemetery in Santiago de Cuba on 4 December. The cemetery is the resting place of 19th-century Cuban independence hero José Martí and numerous other leading figures in the country’s torrid history.

In a telegram to Raúl Castro cited by the Kremlin, the Russian president, Vladimir Putin, said: “The name of this distinguished statesman is rightly considered the symbol of an era in modern world history … Fidel Castro was a sincere and reliable friend of Russia.”

The French president, François Hollande, mourned his loss but noted concerns over human rights under the Castro regime. “Fidel Castro was a towering figure of the 20th century. He incarnated the Cuban revolution, in both its hopes and subsequent disillusionments,” he said.

“France, which condemned human rights abuses in Cuba, had equally challenged the US embargo on Cuba, and France was glad to see the two countries re-establish dialogue and open ties between themselves,” the Socialist party leader added in a statement.

Meanwhile, Jacob Zuma, the president of South Africa, thanked Castro for his help and support in the fight to overthrow apartheid. “President Castro identified with our struggle against apartheid. He inspired the Cuban people to join us in our own struggle against apartheid,” Zuma said in a statement.

Pope Francis also sent Raúl Castro his condolences in a telegram. “I express my sentiments of sorrow to your excellency and other family members of the deceased dignitary, as well as to the people of this beloved nation,” the telegram read. “At the same time, I offer prayers to the Lord for his rest and I trust the whole Cuban people to the maternal intercession of our Lady of the Charity of El Cobre, patroness of this country,” he says.

Castro survived long enough to see Raúl negotiate the opening with Obama. After outlasting nine occupants of the White House, he cautiously blessed the historic deal with his lifelong enemy in a letter published after a month-long silence.

Fidel Castro in a rare public appearance in April 2014. Photograph: Alex Castro/AP

Although the news had long been anticipated in Cuba, the mood in the capital was one of shock, with Havana residents expressing their sense of loss. “I’m speechless. Many Cubans are dismayed,” said Mercedes Copa, 59. “Fidel’s death opens a period of uncertainty. Perhaps today is the start of a new stage in Cuban history,” said Irma Guzman.

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 US attempts to overthrow and weaken the communist government.

As in life, in death Castro was deeply divisive. The announcement of his death was widely greeted online with celebration and condemnation of a “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. As pots and pans were banged in jubilation, there were chants of “Cuba libre!” (Cuba is free) and “el viejo murió” (the old man is dead). Previous false reports of Castro’s death have triggered cavalcades of cheering, flag-waving revellers.

More than half a century ago, his guerrilla army of “bearded ones” replaced Fulgencio Batista’s corrupt dictatorship with communist rule which 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 US that brought the world closer to the brink of nuclear war than it has ever been.

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.

A Havana man is reflected in a mirror hanging on his wall covered with photographs of, left to right, Raúl Castro, Fidel Castro and Ernesto ‘Che’ Guevara. Photograph: Ramon Espinosa/AP

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 that accustomed Cubans to his mortality.

Latin America’s leftwing leaders mourned 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.

Evo Morales, the president of Bolivia and a close ally of the late Cuban leader, said he was deeply saddened at Castro’s death. “Fidel [was] the only man in the world with so many principles and so many values,” he told the Latin American television network Telesur. “He made so much history not only for Cuba, but also for the planet. That is socialism.”

He added: “There will never again be a man or comrade like Fidel, who devoted his life, his knowledge and his struggle not only to the Cuban people but to all the people of the world.”