A thread of reconciliation ran through Tuesday's memorial service for peace icon Nelson Mandela, which was marked by a historic handshake between arch foes America and Cuba.

Several speakers at the memorial service, which gathered tens of thousands of people at Soweto's Soccer City stadium despite persistent rain, referred to Mandela's ability to unite people from opposing camps, even in death.

"He has done it again," said UN Secretary General Ban Ki-moon, gesturing around the Soccer City stadium where rivals both local and international had gathered to honour the memory of South Africa's first black president.

"We see leaders representing many points of view, and people from all walks of life. All here, united," said Ban.

US President Barack Obama shook hands with Raul Castro, leader of long-time Cold War foe Cuba, before mounting the stage to give his speech.

The gesture was interpreted by some as a sign of Obama's willingness to reach out to US enemies.

And the Cuban government hailed it as a hopeful sign, writing on its website: "may this... be the beginning of the end of the US aggressions against Cuba?"

Tuesday's gathering brought together mourners from both sides of the apartheid-era black-white divide, the leaders of other international rivals like Zimbabwe and Britain, as well as representatives of competing South African political parties.

"He (Mandela) showed the awesome power of forgiveness -- and of connecting people with each other... the true meaning of peace," Ban told the crowd.

Cuba and the United States have had limited ties for half a century, most of it under the iron fist rule of Raul's brother Fidel Castro.

Washington has maintained a trade embargo against Cuba for decades.

Obama's gesture was witnessed by millions as the memorial event was broadcast live around the world.

Other mourners referred to Mandela's role as conciliator -- having led negotiations for a peaceful settlement after decades of white minority rule.

Fellow Nobel Peace laureate, archbishop emeritus Desmond Tutu, used the opportunity for a unifying gesture of his own: delivering part of his message in Afrikaans -- the language of the former oppressor.

"God, I ask you to bless our country," the archbishop emeritus prayed as he closed the ceremony.

"You gave us a wonderful gift in this icon of reconciliation", referring to the man known as the father of the South African nation.

Family spokesman Thanduxolo Mandela told the Soweto crowd he was sure Mandela was "smiling from above", looking down on the patchwork of people gathered in his memory.

"As Mandela would have wished it, among those here this morning are the powerful and the weak, the rich and the poor, the mighty and the ordinary, all here ... unified," he said.

"This is what he strove for, the equality of man, the brotherhood of humanity."

Elsewhere, in Cape Town, Mandela's former jailers and fellow prisoners united in his memory across the water from Robben Island where he spent 18 of his 27 years in prison.

"With his death, we have reconciled again as South Africans. We have reconciled as a world community. It is up to us to make that legacy a reality," said former Robben Island inmate Lionel Davis.

"It is our duty that we as South Africa fulfil that legacy of Mandela from today onwards, that we endeavour to break down the barriers that still keep us apart."