Tens of thousands of people have paid tribute to Nelson Mandela at a memorial service held in driving rain in Johannesburg.
The first president of a multi-racial South Africa died last Thursday, aged 95.
Introducing the proceedings, master of ceremonies Cyril Ramaphosa said that Mandela's "long walk is over... and he can finally rest".
US President Barack Obama said Mandela had taught the world the power of action and the power of ideas, and that it had taken a man like Mandela to free not only the prisoner but also the jailer.
On his way to the podium, Obama shook hands with Cuba President Raul Castro, an unprecedented gesture between the leaders of two nations that have been at loggerheads for more than half a century.
In his address, Castro, whose brother Fidel was a staunch apartheid critic, paid tribute to Mandela as the "ultimate symbol of dignity and the revolutionary struggle".
”Never and never again shall it be that this beautiful national shall experience the oppression of one by another” #MandelaMemorial
— Amb.Olunga (@olungaotieno) December 10, 2013
You know you're beast when you get two sworn enemies to shake hands at your funeral. #MandelaMemorial
— Kay Tshekiso™ (@kaytshekiso) December 10, 2013
Amazing day. What an honour to cover! #MandelaMemorial http://t.co/X8L7gYRXHX
— Andrea Vance (@avancenz) December 10, 2013
Awesome ceremony, what a tribute to a great man. And yes, I shook Obama's hand, he's a tall fella #MandelaMemorial
— Pita Sharples (@papapita) December 10, 2013