President Barack Obama said tonight 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 US leader and his family visited the bleak former prison of Robben Island to pay tribute to ex-inmate and former president Mandela.
Mr Obama later cited the legacy of Mr Mandela.
He was imprisoned on the windswept island for 18 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 US head of state, said Mr 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," Mr 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."
Mr 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 Mr 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 Mr 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 Mr 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 Mr Mandela's election victory.
On Robben Island, Mr Obama also visited Mr Mandela's cell, repeating a previous visit he made as a US senator in 2006.
After touring the former prison, Mr Obama and his wife Michelle signed a guest book in which Mr 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 Mr Obama's eight-day Africa trip. South Africa says his condition is "critical but stable".
Mr Obama met Mr Mandela's relatives in Johannesburg yesterday 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 US leader describes Mr Mandela as a "personal hero", and has reminded his audiences in Africa that his first political activism was to urge his US college to divest itself of South African investments to protest against apartheid.
Mr Obama's aides said he chose the University of Cape Town as the venue for his major Africa speech because of the address US Senator Robert Kennedy gave there in 1966 comparing the fight to overcome apartheid with the US 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," Mr Obama said.
Not everyone was impressed by Mr Obama's presence. Some protesters had gathered outside the university ahead of his speech, holding placards attacking US foreign policy reading "Obama mass killer" and "End drone wars now".
Mr 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 Mr Obama to Senegal, South Africa and Tanzania.
Mr 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 US 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 $7bn 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," Mr Obama said.
"So, I'm calling for America to up our game when it comes to Africa," he added, saying the US 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, Mr Obama also visited a health centre to highlight US efforts to combat HIV/AIDS on the continent.
During that visit, another anti-apartheid veteran, retired Anglican Bishop Desmond Tutu, told Mr 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," Archbishop Tutu told him.