President Obama on Tuesday implored African leaders to build strong economies and education systems today to provide opportunities for Africa's rapidly growing youth population, and warned that ignoring these priorities could lead to instability years down the road.

"[O]n the one hand, this could bring tremendous opportunities," Obama said of expectations that Africa's population will double in the coming decades and be made up mostly of young people. "Economists will tell you … it's a demographic edge and advantage, but only if those young people are being trained."

"We need only to look at the Middle East and North Africa to see that large numbers of young people with no jobs and stifled voices can fuel instability and disorder," he said.

"Africa will need to generate millions more jobs than it's doing right now," he said. "The choices made today will shape the trajectory of Africa and therefore the world for decades to come."

In addition to ensuring that Africa's youth is not idle and has educational opportunities, African leaders need to pay special attention to women and girls.

"We can't let old traditions stand in the way," Obama said, echoing comments he made over the weekend in Kenya. "When African girls are subjected to the mutilation of their bodies, or forced into marriage at the ages of 9 or 10 or 11 … that's not a good tradition. It needs to end."

The explosion of new HIV cases concentrated among teenage girls and the acceptance of domestic violence and rape as a weapon of war are all bad traditions Africa needs to drop, Obama said.

"And when girls cannot go to school and grow up not knowing how to read or write … that's a bad tradition," Obama continued. "We'll all be better off when women have equal futures," he said.

On the last day of his five-day trip to Africa, Obama more broadly encouraged all countries to invest in Africa.

"When more countries invest responsibly in Africa, it creates more jobs and prosperity for us all," Obama told the African Union on Tuesday. "So I want to encourage everybody to do business with Africa, and African countries should want to do business with every country."

As part of changing the world's approach to Africa, however, foreign investment needs to be mutually beneficial, Obama said.

"But economic relationships can't simply be about building countries' infrastructure with foreign labor or extracting Africa's natural resources," Obama continued. "Real economic partnerships have to be a good deal for Africa, they have to create jobs and capacity for Africans."

Obama told the leaders assembled in Addis Ababa, Ethiopia, that he wants to be the U.S. president that finds a way to "transform America's relationship with Africa."