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 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 giant 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 White House played down the move, saying it was a routine pleasantry, not a sign of a policy change.
"Nothing was planned in terms of the president's role other than his remarks," Deputy National Security Adviser Ben Rhodes told reporters travelling with Obama. "He really didn't do more than exchange greetings with those leaders on his way to speak, it wasn't a substantive discussion."
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 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.
In Cuba, state-run television broadcast the Obama-Castro handshake without commentary, along with Castro's speech.
Some Cubans said they hoped the gesture could help to foster better ties. "I never imagined such a thing could happen," said Yesniel Soto, 25, on her way to a government job in Havana. "I see it as something that has begun to change, a change we are all hoping for."
Such hopes have been fuelled by several recent instances when cooperation has replaced hostile rhetoric.
Obama questioned last month in Miami whether an embargo put in place in the 1960s remained an effective way of tackling the United States' differences with Cuba.
But Rhodes noted that, while Washington has eased bans on family travel and remittances to Cuba, and taken other steps to allow greater contacts, points of friction remain.
"We continue to have the same grave concerns about both the human rights situation in Cuba and Alan Gross," he said.
Gross is a U.S. government contractor jailed in Cuba for committing what a judge called a crime against the state.
Meanwhile the crowd's reaction to Zuma - many gave the thumbs-down sign or rolled their wrists in a soccer substitution gesture - is a worrying sign for his African National Congress (ANC) as it heads for polls in six months.
Although Africa's biggest economy has been transformed 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 next year. Party spokesman Jackson Mthembu dismissed the jeers as a "little blot" on 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 ceremony at the stadium - scene of the 2010 World Cup final - was the centrepiece of a week of mourning.
Mandela, revered across the world as a symbol of reconciliation and forgiveness, 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.
Mandela's remains will 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.
Additional reporting by David Dolan, Peroshni Govender in Johannesburg, Rosa-Tania Valdes in Havana, Mark Felsenthal in Washington; Writing by Pascal Fletcher and Ed Cropley; Editing by Janet Lawrence and Kevin Liffey