Cape Town - US President Barack Obama warned on Sunday that Africa could only fulfil its rising potential with leaders who serve their people, not tyrants who enrich themselves.
In a strident call for democratic change and good governance, Obama used the political legacy of ailing Nelson Mandela and South Africa's emergence from grim years of apartheid as proof that freedom will ultimately prevail.
"In too many countries, the actions of thugs and warlords and human traffickers hold back the promise of Africa," Obama said at a speech at the University of Cape Town.
"America cannot put a stop to these tragedies alone, and you don't expect us to. That is a job for Africans. But we can help you and we will help you," he said, announcing major new US programmes to boost electricity and health care.
"History shows us that progress is only possible where governments exist to serve their people and not the other way around," said Obama, in a line that drew loud and prolonged cheers from his audience of more than 1 000 people.
The speech was delivered from the same spot where American political icon Robert F Kennedy delivered his famous "ripple of hope" speech in 1966, which called on students to decry the "racial inequality of apartheid".
Obama's goal was to inspire a new generation of Africans with the belief that they could ignite political change and the potential of their continent.
He slammed leaders who "steal or kill or disenfranchise voters", saying that the ultimate lesson of South Africa was that such brutal tactics will not work.
"So long as parts of Africa continue to be ravaged by war and mayhem, opportunity and democracy cannot take root," said Obama.
"Across the continent, there are places where still, fear often prevails," Obama said, warning of "senseless terrorism" from Mali to Mogadishu.
"From Congo to Sudan, conflicts fester," Obama said, hitting out at those who argue that American calls for democracy and freedom are "intrusive" or "meddling".
He also condemned the rule of Robert Mugabe in neighbouring Zimbabwe, where he said the "promise of liberation gave way to the corruption of power and the collapse of the economy".
Like the rest of Obama's trip to South Africa, the speech was rich in emotion when he mentioned his hero Mandela, who lies critically ill in a Pretoria hospital.
"You have shown us how a prisoner can become president," Obama said.