In his farewell speech capping a historic trip to Kenya and Ethiopia, U.S. President Barack Obama hailed Africa's extraordinary progress, while noting that such progress can only be sustained through continued development and democracy for all.

“I stand before you as a proud American. I also stand before you as the son of an African,” Obama said Tuesday. With those words, the first sitting U.S. president to address the African Union encapsulated his personal interest in seeing Africa’s continued economic and developmental growth as it sheds a history of colonialism.

“A half century into this independence era, it is long past time to put aside old stereotypes of an Africa forever mired in poverty and conflict. The world must recognize Africa’s extraordinary progress,” he said.

Obama hailed the continent’s gains, from a plummeting HIV/AIDS infections rate to millions of Africans being lifted out of poverty, while championing the U.S. role in such gains.

​US initiatives to support Africa

President Obama highlighted his renewal of the African Growth and Opportunity Act aimed at boosting trade and U.S. initiatives focused on food security, increasing access to electricity, and supporting African entrepreneurs.

While not naming China, Obama emphasized what sets the United States apart in its investment in Africa.

“Economic relationships cannot simply be about other countries building infrastructure with foreign labor or extracting Africa’s natural resources. Real economic partnerships have to be a good deal for Africa—they have to create jobs and capacity for Africans. That’s the kind of partnership America offers,” he said.

But the American leader cautioned the continent’s progress “rests on a fragile foundation,” with hundreds of millions of Africans still living in extreme poverty without access to basic infrastructure.

"Alongside high-tech hubs of innovation, many Africans are crowded into shantytowns without power or running water—a level of poverty that’s an assault on human dignity," he said.

In a message he also honed during his visit to Kenya, President Obama noted that nothing will unlock Africa’s economic potential more than ending “the cancer of corruption.”

"Here in Africa, corruption drains billions of dollars from economies—money that could be used to create jobs and to build hospitals and schools. And when someone has to pay a bribe just to start a business or go to school or to get an official to do their job—that’s not “the African way”—it undermines the dignity of the people you represent.” he said.

He said Africa's progress will also depend on democracy - free and fair elections, freedom of speech, press and assembly.

WATCH: President Obama's remarks on Term limits

Embed code

Copy and paste the embed code below. The code changes based on your selection.

Share this video

He added that the continent's democratic progress is at risk from leaders who refuse to step aside when their terms end.

"I have to be honest with you—I just don’t understand this. I am in my second term. Under our constitution, I cannot run again," Obama added, drawing cheers and applause from those attending the speech.

He warned that the fight against terrorists might never be won unless governments address the grievances many terrorists exploit.

"Africa’s progress will also depend on security and peace—because an essential part of human dignity is being safe and free from fear," Obama said.

He stressed that in the face of threats, Africa and the African Union has shown leadership. He said al-Shabab controls less territory because of the AU force in Somalia and that forces from several nations with the backing of the AU are fighting to end Boko Haram's "senseless brutality" in the Lake Chad basin.

U.S. President Barack Obama (L) speaks with a farmer (2nd R) participating in the Feed the Future program as he tours the Faffa Food factory in Addis Ababa, Ethiopia July 28, 2015.

New US funds for 'Feed the Future'

Earlier Tuesday, President Obama the Faffa Foods plant in Addis Ababa, which is supported by the U.S. government initiative Feed the Future aimed at promoting food security to combat hunger, poverty and malnutrition.

According to the White House, Faffa produces 25,000 tons a year of supplemental foods including fortified milk powders and baby food. Some of Faffa’s products are sold to the U.N. World Food Program for distribution to vulnerable populations and refugees along the Somali and South Sudanese border. Faffa is also the primary supplier of baby food for Ethiopian children.

The U.S. government announced Tuesday a $140 million in Feed the Future investments aimed at getting climate-resilient seeds – including maize, legumes, rice, and wheat – to smallholder farmers in 11 African countries. The government says the initiative is expected to benefit more than 11 million households across Africa over the next three years.

“The goal is to drastically increase the productivity of a small farmers all throughout Africa because what we know is that a huge percentage of Africans are still getting their incomes from agriculture and most of them are very small plots, and not a lot of technology,” Obama said. "But with just a few smart interventions, a little bit of help, they can make huge improvements in their overall yield.”

WATCH: Anita Powell reports from Addis Ababa, Ethiopia

Embed code

Copy and paste the embed code below. The code changes based on your selection.

Share this video

Obama met Monday with Ethiopian Prime Minister Hailemariam Desalegn for what he called "frank discussions" that included urging the government to allow journalists and opposition parties to operate more freely. He said creating space for those voices "will strengthen rather than inhibit" the ruling party's agenda.

Hailemariam said Ethiopia is committed to improving human rights and governance. "Our commitment to democracy is real, not skin deep," he said.

​Obama met Monday with Ethiopian Prime Minister Hailemariam Desalegn for what he called "frank discussions" that included urging the government to allow journalists and opposition parties to operate more freely. He said creating space for those voices "will strengthen rather than inhibit" the ruling party's agenda.

Hailemariam said Ethiopia is committed to improving human rights and governance. "Our commitment to democracy is real, not skin deep," he said.

South Sudan

President Obama also focused Monday on the civil war in South Sudan, saying before a meeting with leaders from Kenya, Uganda, Ethiopia and the AU that conditions in the country are getting "much, much worse." He said South Sudan's president and opposition leaders have been stubborn and are looking out for their own self-interests rather than the interest of the country.

The leaders at Monday's meeting agreed that South Sudan's leaders need to reach a peace deal by an August 17 deadline, the White House said. A U.S. official told reporters that the leaders discussed options for penalties if there is no deal, including imposing sanctions and deploying a regional intervention force.

South Sudan was thrown into conflict more than a year and-a-half ago when clashes broke out between forces loyal to the president and vice president.

President Barack Obama speaks during a news conference with Kenyan President Uhuru Kenyatta at the State House in Nairobi, Kenya, July 25, 2015.

Kenya visit

Before Ethiopia, Obama spent two days in his father's homeland of Kenya, where he was hailed as a native son.

In a speech before his departure Sunday, the president said Kenya is at a crossroads "filled with peril, but also with enormous promise."

In Nairobi, the president praised Kenya's achievements winning independence in 1963, among them ending one-party rule and overcoming the deadly tribal and ethnic violence that broke out in 2007 and plagued the country for several months. "The people of Kenya chose not to be defined by the hatreds of the past," Obama said, "you chose a better history."​