CAPE TOWN, South Africa – President Obama challenged Africa’s young people Sunday to build on the remarkable progress the continent has made by promoting democratic and honest government and a thriving middle class.

“There is an energy here that can’t be denied,” he said. “Africa rising.”

Obama acknowledged the immense changes that have transformed sub-Saharan African in recent years, speaking on the same campus where Robert F. Kennedy in 1966 delivered his Day of Affirmation speech about the spread of civil rights, and just hours after Obama took his family to see the prison that held Nelson Mandela in the days of apartheid.

But he cautioned that, despite freer societies and growing economies, much needs to be done to eradicate poverty, shed corruption and eliminate conflict.

“We know this progress rests on a fragile foundation,” he said. “Across Africa, the same institutions that should be the backbone of democracy can all too often be infected with the rot of corruption.”

Obama pledged that the United States would do its part, not by offering handouts, but by partnering with African governments and private companies to lure businesses to the continent. That would come in the form of a new $7 billion program to double access to electricity and continuing efforts to produce new food technologies and reduce illness.

“We are moving beyond the simple provision of assistance, foreign aid, to a new model of partnership,” he said.

The goal, he said, is to boost a middle class that will benefit both the United States and Africa.

“This is America’s vision. A partnership with Africa that unleashes growth and the potential of every citizen, not just a few at the very top.”

Earlier Sunday, Obama, his wife and daughters toured Robben Island, where Mandela was held in a small cell for 18 of his 27 years in prison as a political prisoner of the white leaders who ruled the nation. Obama had been there before but it was his family’s first visit.

“On behalf of our family we’re deeply humbled to stand where men of such courage faced down injustice and refused to yield,” Obama wrote in the guest book. “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.”

Obama, much like Kennedy before him, encouraged young Africans to take the mantle from their leaders, working to help nations and societies.