John Atta Mills, the Ghanaian president who greeted Obama on his arrival in Accra on Friday evening, was elected in a peaceful, transparent vote in December that set an example for the continent.
'Blood of Africa'
Obama, who's father was born in Kenya, also spoke of his personal connection with the continent.
"I have the blood of Africa within me and my family story encompasses both the tragedies and triumphs of the African story," he told the audience of politicians and other officials.
Al Jazeera's Yvonne Ndege, reporting from Accra, said that the packed auditorium gave Obama a standing ovation as he arrived to give the speech.
"The hundreds of people who were present could not honestly believe that they were setting eyes on the first African-American president of the United States," she said.
"When he talked of having African blood running through his veins they simply went wild."
Ghana, a cocoa- and gold-producing country, is set to begin pumping oil next year and has embarked on economic reforms that have helped bring unprecedented investment and growth.
Obama pledged that the US would work with African nations to promote trade and investment and would continue the efforts of George Bush, his predecessor, to help tackle HIV/Aids.
"Wealthy nations must open our doors to goods and services from Africa in a meaningful way," he said.
The US president said there must be a partnership of "mutual responsibility" between the continent and the rest of the world in order to improve the lives of all people.
"I see Africa as a fundamental part of our interconnected world - as partners with America on behalf of the future that we want for all our children."
'Not a messiah'
Austin Chakaodza, a London-based Africa analyst, told Al Jazeera that Obama had articulated an "enlightened" foreign policy and had a better understanding of African issues than his predecessors.
"I have the blood of Africa within me and my family story encompasses both the tragedies and triumphs of the African story"
"If he is true to what he is saying, then definitely there is a change in culture and style, but I would continue to say there is no change in substance," he said.
Bunmi Akpata-Ohohe, of the London-based Africa Today magazine, cautioned that, as US president, Obama could "only do so much" for Ghana and Africa.
"Obama is not a messiah; Obama is only on the agenda of America. He is only an American president," she told Al Jazeera.
Thousands of Ghanaians had packed the dark streets around the airport, hoping for a glimpse of Obama as he arrived on his first visit to sub-Saharan Africa since taking office in January.
Obama has since returned to the United States.