CAPE TOWN (Reuters) - President Barack Obama said on Sunday the United States would help propel Africa along a path of prosperity and peace, and urged the continent to follow the example of Nelson Mandela.
In South Africa on the second leg of a three-nation Africa trip, the U.S. leader and his family visited the bleak former prison of Robben Island to pay tribute to ex-inmate and former president Mandela, now critically ill in hospital.
Obama later cited the legacy of Mandela, who was imprisoned on the windswept island for most of the 27 years he spent in jail before becoming the country's first black president, in a speech at the University of Cape Town.
The president, the first African American U.S. head of state, said Mandela's struggle against apartheid paved the way for freedom and opportunity well beyond South Africa's borders.
"Nelson Mandela showed us that one man's courage can move the world," Obama said.
He urged his audience at the university not to rest until more was done to eradicate poverty and disease and end government corruption and war.
"There is an energy here: Africa rising," he said. "We know this progress, though, rests on a fragile foundation. We know this progress is uneven."
Obama said his visit to Robben Island was particularly powerful for him because he could share the experience with his daughters, Malia, 15, and Sasha, 12.
"I knew that they now appreciated a little bit more the sacrifices that Madiba and others had made for freedom," he said, using Mandela's Xhosa clan name.
The Obamas flew by helicopter to the island, which is surrounded by the shark-infested waters of the South Atlantic.
His party drove a short distance to the former prison's lime quarry, where Mandela and other prisoners toiled for years.
Their guide, 83-year-old former inmate and anti-apartheid activist Ahmed Kathrada, spoke about his time there with Mandela and other African National Congress prisoners.
Current South African President Jacob Zuma was also held at the notorious jail off Cape Town's coast under the apartheid regime, which ended in 1994 with Mandela's election victory.
On Robben Island, Obama also visited Mandela's cell, repeating a previous visit he made as a U.S. senator in 2006.
After touring the former prison, Obama and his wife Michelle signed a guest book in which Obama wrote: "On behalf of our family we're deeply humbled to stand where men of such courage faced down injustice and refused to yield.
"The world is grateful for the heroes of Robben Island, who remind us that no shackles or cells can match the strength of the human spirit."
The 94-year-old Mandela's struggle with a lung infection has been a sombre backdrop to Obama's eight-day Africa trip. South Africa says his condition is "critical but stable".
Obama met Mandela's relatives in Johannesburg on Saturday to deliver a message of support instead of directly visiting the frail former president at the hospital where he has spent the last three weeks.
The U.S. leader describes Mandela as a "personal hero", and has reminded his audiences in Africa that his first political activism was to urge his U.S. college to divest itself of South African investments to protest against apartheid.
Obama's aides said he chose the University of Cape Town as the venue for his major Africa speech because of the address U.S. Senator Robert Kennedy gave there in 1966 comparing the fight to overcome apartheid with the U.S. civil rights movement.
"It would have seemed inconceivable at that time that less than 50 years later an African American president might address an integrated audience at South Africa's oldest university and that this same university would have conferred an honorary degree to a President Mandela," Obama said.
Not everyone was impressed by Obama's presence. Some protesters had gathered outside the university ahead of his speech, holding placards attacking U.S. foreign policy reading "Obama mass killer" and "End drone wars now".
Obama praised Africa's rapid economic development, but challenged his audience not to be content with progress so far but to push ahead to lift Africans out of poverty, combat government corruption and improve health and living standards.
"We've got more work to do," he said in the middle of a trip taking Obama to Senegal, South Africa and Tanzania.
Obama has tried to overcome the perception that he has ignored a continent which has become a major target of Chinese investment and trade.
Many Africans are disappointed that despite the U.S. president's Kenyan ancestry, his only previous visit to the continent while in office was to Ghana in 2009.
In Cape Town, the president announced a $7 billion U.S. initiative to double access to electric power on a continent where only one in three people have electricity.
"More and more African economies are poised to take off and increased trade and investment from the United States has the potential to accelerate these trends, creating new jobs and opportunities on both sides of the Atlantic," Obama said.
"So, I'm calling for America to up our game when it comes to Africa," he added, saying Washington would launch new trade missions and initiatives to promote investment.
This would include the renewal of an agreement to cut tariffs on African exports to the United States.
While in Cape Town, Obama also visited a health center to highlight U.S. efforts to combat HIV/AIDS on the continent.
During that visit, another anti-apartheid veteran, retired Anglican Bishop Desmond Tutu, told Obama that Africans felt an affinity with him and had high expectations of him.
"Your success is our success. Your failure, whether you like it or not, is our failure," Tutu told him.
Additional reporting by Wendell Roelf, Pascal Fletcher and Ed Stoddard; Writing by Mark Felsenthal; Editing by Pascal Fletcher and Andrew Roche