South American leaders joined thousands of ordinary Cubans at a huge rally in Havana's Plaza of the Revolution to honour Fidel Castro.
Castro's brother and successor, Raul, was among the enormous crowds of mourners that included the presidents of Mexico, Ecuador, Bolivia, Venezuela, Panama, South Africa and Zimbabwe as well as leaders from Caribbean nations.
In a speech to the crowd, South African President Jacob Zuma praised Cuba under Castro for its record on education and health care and its support for African independence struggles.
Castro will be remembered as "a great fighter for the idea that the poor have a right to live with dignity," Mr Zuma said.
The rally began with black-and-white revolution-era footage of Castro and other guerrillas on a big screen and the playing of the Cuban national anthem.
Raul Castro closed the rally with a speech thanking world leaders for their words of praise for his brother, who he called the leader of a revolution "for the humble, and by the humble."
People had started queuing early on Tuesday outside the Plaza of the Revolution, the heart of government power and the scene of many of Castro's famous speeches, hoping to pay tribute to their late leader.
Chants of "Viva Fidel!" and "united, the people will never be defeated!" rang out across the square.
"I feel a deep sadness, but immense pride in having had him near," said Ana Beatriz Perez, a 50-year-old medical researcher.
"His physical departure gives us strength to continue advancing in his ideology. This isn't going away, because we are millions."