Mr Obama will also become the first US president to address the African Union at its gleaming Chinese-built headquarters, with remarks that may touch on Africa’s democracy deficit.

He will also hold talks with regional leaders on the civil war in South Sudan.

Mr Obama travelled to Ethiopia after concluding a visit to Kenya where he urged an end to corruption, saying that money spent on bribes would be better paid to someone “doing an honest day’s work”.

He said Kenya has to deepen democracy and end exclusion based on gender or ethnicity.

After political talks with President Uhuru Kenyatta on security and business, in a speech yesterday to a packed sports hall in Nairobi he struck a personal note, talking of his own experience and Kenya’s in the five decades since independence.

“I’m here as president of a country that sees Kenya as an important partner. I’m here as a friend who wants Kenya to succeed,” he said.

His half-sister Auma Obama introduced him to a crowd of 4,500, many of whom had secured tickets to attend.

To a mixture of applause and laughter, he described being picked up at the airport on his first visit to Kenya in the 1980s by his sister in an old VW Beetle that often broke down.

This time, he arrived on Air Force One and travelled in the president’s armoured car nicknamed “the Beast.”

“When it comes to the people of Kenya, particularly the youth, I believe there is no limit to what you can achieve,” he said, but he told Kenyans that building their nation and the economy required personal effort and responsibility.

Referring to ethnic fighting in which 1,200 people died after a disputed 2007 election, he told Kenyans that politics based on ethnicity was “doomed to tear a country apart.”

He also warned Kenya would “not succeed if it treats women and girls as second-class citizens.”

President Obama spoke of Kenya’s challenge in dealing with attacks by the Somali Islamist militant group al- Shabaab, and promised the United States would stand by Kenya as a “partner”.

Yesterday, he offered extra counter-terrorism training and funds.

Kenya’s tourist industry has been hammered by attacks by al-Shabaab, who raided a Nairobi shopping mall in 2013 and attacked a university in the northeast in April, killing dozens of people.

President Obama, whose father is buried in western Kenya, wants to boost business ties with Africa, one of the world’s fastest growing regions.

“Kenya is on the move, Africa is on the move,” he told the crowd at the sports hall.