US President Barack Obama warned yesterday that Africa could only fulfill 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 Cape Town University.

“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 healthcare.

“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 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.

President Barack Obama was “deeply humbled” by a visit to the cell where Nelson Mandela spent years as a prisoner, in a solemn homage yesterday to the critically ill hero he was unable to see in Pretoria.

The US leader paid tribute to Mandela and other anti-apartheid inmates of Robben Island, who “refused to yield” in the face of racist white minority rule.

Obama, accompanied by his wife Michelle and young daughters Sasha and Malia, visited the bleak lime quarry where 34 anti-apartheid leaders—including Mandela—endured hours of backbreaking work.

He stood alone, looking out the barred window of the small damp cell where Mandela spent two thirds of his 27 years in prison, his darkest days of his detention.

After touring the sandy wind-swept island, Obama took a few minutes to write a note in the visitors book.

“On behalf of our family we’re deeply humbled to stand where men of such courage faced down injustice and refused to yield,” he wrote.

“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.” Mandela’s illness placed Obama in a tricky political spot, forcing him to balance his desire to push for a new economic relationship with Africa, with the need to properly honour his hero, who has been in intensive care for more than three weeks.

On Saturday, Obama and his wife Michelle called Mandela’s wife Graca Machel, and the president then privately visited several daughters and grandchildren of Mandela, to offer support and prayers.

But he decided against rolling up in his massive entourage at the Pretoria hospital where the 94-year-old Mandela lies, worried that he would disturb his peace.

“I expressed my hope that Madiba draws peace and comfort from the time that he is spending with loved ones,” Obama said in a statement using Mandela’s clan name.

Machel said she drew “strength from the support” of the Obama family.

The example of Mandela, who became South Africa’s first black president, drew Obama into politics for the first time in the 1970s, putting him on a path that would lead to his own piece of history as America’s first black president.

“The struggle here against apartheid, for freedom, Madiba’s moral courage, his country’s historic transition to a free and democratic nation, has been a personal inspiration to me,” Obama said Saturday in Pretoria.

“It has been an inspiration to the world.”

South African President Jacob Zuma said after talks with Obama that Mandela remained in a “critical but stable” condition with a recurring lung infection.  And he said that Obama and Mandela were “bound by history” after breaking racial barriers to rise to power.

“You both carry the dreams of millions of people in Africa,” Zuma, who also spent 10 years on Robben island, told Obama.

South Africa’s last apartheid president FW de Klerk meanwhile cut short a visit to Europe because of the ailing health of his co-Nobel Peace Prize winner.

Obama’s warm welcome however was not universal. Riot police fired rubber bullets and stun grenades at around 300 hundred anti-Obama protesters on Saturday in the township of Soweto, once a flashpoint in the anti-apartheid struggle.

RFK gave his famed “ripple of hope” speech at the same venue in 1966, which was a call for non-violent change and equality, at a time when America was still dealing with the racial discrimination which stained its own history.

Kennedy gave the speech only two years after Mandela was sentenced to life in prison and sent to Robben Island.

Mandela, once branded a terrorist by the United States and Britain, was freed in 1990 and became president after the first fully democratic elections in 1994.