(CNN) - President Obama praised Ghana on Saturday for working to put its democratic government on a firmer footing, with peaceful transfers to powers.
Obama stressed that all nations must support "strong and sustainable" governments.
Watch: Obama speaks in Ghana
"History offers a clear verdict: Governments that respect the will of their own people are more prosperous, more stable, and more successful than governments that do not," he told Ghana's Parliament.
Obama said that much of Africa's promise is going unfulfilled, and he pointed to Kenya - where his father was born - as an example.
"Countries like Kenya, which had a per-capita economy larger than South Korea's when I was born, have been badly outpaced. Disease and conflict have ravaged parts of the African continent. In many places, the hope of my father's generation gave way to cynicism, even despair," he said.
"The 21st century will be shaped by what happens not just in Rome or Moscow or Washington, but by what happens in [Ghana's capital of] Accra as well," Obama said to applause.
The visit by the first African-American president in the United States sparked a frenzy in the country as street vendors sold miniature U.S. flags, and massive billboards with pictures of a smiling Obama and "akwaaba, " the local word for welcome, were set up in the capital city.