As the presidents arrived in the tent, an announcer attempted to pump up the crowd.
"The first black president of the United States!" he boomed. "History! History! History is being made today in Ghana, where democracy has become the watchword of all Ghanaian people. Africa meets one of its illustrious sons, Barack Obama."
Obama is the third consecutive American president to visit Ghana. Bill Clinton spoke to an enthusiastic audience of hundreds of thousands in Accra in 1998. George W. Bush visited here in 2008, and a highway here is named in his honor.
Obama and his wife, first lady Michelle Obama, visited a hospital in Accra that focuses on maternal and child health care. The Obamas met with doctors and nurses and held several babies, which the president called a highlight of the trip.
"Look at these cuties," he said.
ABC News' Dana Hughes contributed to this report.