World leaders have paid tribute to Fidel Castro, the Cuban revolutionary leader who built a communist state on the doorstep of the United States.
But in death just as in life he divided opinion and critics have labelled him a "tyrant".
Castro died on Friday aged 90, his younger brother and successor Raul Castro announced on state television.
Mikhail Gorbachev, the final leader of the Soviet Union which had long acted as an economic and political prop for Cuba, said Castro left a lasting mark on his country and on world history.
"Fidel held his ground and strengthened his country at the time of the harshest American blockade, at the time of massive pressure on him," Mr Gorbachev was quoted by Interfax news agency as saying.
"Nevertheless he led out his country from the blockade to the path of self-sustained and independent development."
In a telegram of condolence to Raul Castro, Russian President Vladimir Putin called the late leader an "inspiring example for many countries".
"Fidel Castro was a frank and tried and true friend of Russia," the Kremlin quoted the message as saying.
In Venezuela, a long-time ally of Cuba and staunch opponent of the political stance of the United States, President Nicolas Maduro said Castro had inspired and would continue to inspire his country.
"We will keep on winning and keep fighting. Fidel Castro is an example of the fight for all the people of the world. We will go forward with his legacy," Maduro told television station Telesur.
Ecuadorean President Rafael Correa said: "A great has left us. Fidel has died. Long live Cuba! Long live Latin America!"
South African President Jacob Zuma thanked the Cuban leader for his help and support in the struggle 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," he said.
French President Francois Hollande mourned the loss of a major figure and welcomed the rapprochement between Havana and Washington, while noting concerns over human rights under Castro.
"Fidel Castro was a towering figure of the 20th century. He incarnated the Cuban revolution, in both its hopes and subsequent disillusionments," Hollande said in a statement.
"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," added the Socialist party leader.
Hollande met Fidel Castro in May, 2015 during the first ever visit by a French head of state to Cuba since the Cuban revolution.
US President-elect Donald Trump has given his first reaction to the death of Fidel Castro, saying on Twitter, "Fidel Castro is dead!", without elaborating.
Trump, who takes office on January 20, threatened during his campaign to reverse President Barack Obama's moves to open relations with Cuba over concerns about religious freedom.
But Trump also is looking ahead.
He says that while Cuba "remains a totalitarian island," he hopes Castro's death "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."
Pope Francis says the death of Cuba's revolutionary leader Fidel Castro is "sad news" and that he's grieving and praying for his repose.
Francis expressed his condolences in a Spanish-language message to Fidel's brother, President Raul Castro on Saturday.
The Pope, who met Fidel Castro when he visited Cuba last year, said he had received the "sad news" and added: "I express to you my sentiments of grief."
Fidel Castro, who was a professed atheist, was baptised as a Catholic and educated in schools run by the Jesuits, the religious order of which the Pope is a member.