By Stella Mapenzauswa and Steve Holland
JOHANNESBURG (Reuters) - U.S. President Barack Obama shook hands with Cuba's Raul Castro at a memorial for Nelson Mandela on Tuesday, a rare gesture between the leaders of two ideological opponents that reflected the anti-apartheid hero's spirit of reconciliation.
But the peace and harmony did not stretch to South African President Jacob Zuma, whom the crowd at the rain-soaked Soccer City stadium in Johannesburg booed and jeered as he prepared to give his closing address.
Mandela's death on Thursday at the age of 95 has diverted attention from a slew of corruption scandals in Zuma's administration, while underscoring the gulf between South Africa's first black president, a towering figure of the 20th century, and its fourth.
"Mandela had a vision. Mandela lived that vision," said Funeka Gingcara-Sithole, 31, who was in the crowd. "But what Zuma speaks, he doesn't live. He should do the honourable thing and resign."
Zuma's reception was a marked contrast to the rock-star welcome for Obama, one of about 90 world leaders bidding farewell to Mandela in Johannesburg.
As he bounded onto the podium, Obama extended his hand to communist leader Castro, who shook it and smiled back.
The only previous known handshake between U.S. and Cuban presidents since the island's 1959 revolution was at the United Nations in 2000, when Raul's brother Fidel shook the hand of then-U.S. president Bill Clinton in a chance encounter.
Obama's gesture of friendship did not prevent him delivering tough words to leaders who, he said, invoked Mandela's struggle against oppression while quashing opposition and dissent at home.
"There are too many of us who happily embrace Madiba's legacy of racial reconciliation, but passionately resist even modest reforms that would challenge chronic poverty and growing inequality," he said, speaking yards away from Castro and Chinese Vice-President Li Yuanchao.
"There are too many leaders who claim solidarity with Madiba's struggle for freedom but do not tolerate dissent from their own people," he added, using Mandela's clan name.
The crowd's reaction to Zuma - many also gave the thumbs down sign or rolled their wrists in a soccer substitution gesture - is a worrying sign for the ruling African National Congress (ANC) as it heads towards an election in six months.
Although Africa's biggest economy has undergone huge change since the end of white-minority rule in 1994, it remains one of the world's most unequal societies, plagued by poverty, crime and unemployment.
Even though its support is waning, the 101-year-old ANC is almost certain to keep power in next year's vote. Party spokesman Jackson Mthembu dismissed the jeers as a "little blot" marring an otherwise successful event.
"It came as a bolt to all of us. We were quite surprised," he told ENCA television. "The ANC thinks that this would not have been the best platform to convey such views."
Coinciding with U.N. Human Rights Day, the memorial at the stadium - scene of the 2010 World Cup final - was the centrepiece of a week of mourning for Mandela, who was revered across the world as a symbol of reconciliation and forgiveness.
SINGING IN THE RAIN
He shared the 1993 Nobel Peace Prize with South Africa's last white president, F.W. de Klerk.
"He was more than one of the greatest leaders of our time. He was one of our greatest teachers," U.N. Secretary General Ban Ki-moon told the crowd. "His baobab tree has left deep roots that reach across the planet."
Since Mandela's death, Johannesburg has been blanketed in cloud and torrential rain - a sign, according to African culture, of an esteemed elder passing on and being welcomed into the afterlife by his ancestors.
The atmosphere before the ceremony was one of joy and celebration, more akin to the opening game of the World Cup.
Whites and blacks danced, waved flags, blew plastic "vuvuzela" trumpets and sang anthems from the long struggle against apartheid. The packed carriages of commuter trains heading to the ground swayed side-to-side with the rhythm.
"I was here in 1990 when Mandela was freed and I am here again to say goodbye," said Beauty Pule, 51. "I am sure Mandela was proud of the South Africa he helped create. It's not perfect but no one is perfect, and we have made great strides."
The celebrities in attendance included singers Bono and Peter Gabriel, film star Charlize Theron, model Naomi Campbell and Virgin boss Richard Branson. Francois Pienaar, captain of the 1995 rugby World Cup-winning Springbok side, was also in the stands.
After Tuesday's event, Mandela's remains were to lie in state for three days at the Union Buildings in Pretoria, where he was sworn in as president in 1994.
He will be buried on Sunday in Qunu, his ancestral home in the rolling hills of the Eastern Cape province, 700 km (450 miles) south of Johannesburg. Only a few world leaders are due to attend what will be a more intimate family affair.