The US president praised the growth prospects for Africa despite its experiences of terrorism in recent years, saying that entrepreneurship offered “a positive alternative” to security threats.

“The challenges of terrorism are ones that have to be addressed, but the opportunities for growth and prosperity … are the things that the people of Africa are most hungry for,” Barack Obama said during his visit to Kenya, the first by a US president.

No single country can deal with this problemKenyan president on terrorism

He said African entrepreneurs could help counter violent ideologies and make the continent a centre for global growth, helping create opportunities in Africa that could outdo any threat from terrorism.

Kenya is the homeland of Mr Obama’s father and the biggest economy in east Africa. But it has also suffered from a spate of attacks by Somali Islamist militant group al-Shabaab.

In April this year, al-Shabaab attacked a university in Kenya’s north east near the Somali border, killing 148 people.

‘We need to partner’

President Uhuru Kenyatta called the United States a “very strong supporter of Kenya” and said his country needed help to tackle security threats.

“No single country can deal with this problem,” he added during talks with Mr Obama. “We need to partner.”

The talks at State House were attended by Kenya’s Deputy President William Ruto, who is facing charges at the International Criminal Court that he fomented ethnic killings after Kenya’s disputed 2007 election. He denies the charges.

Mr Kenyatta had faced similar charges, but these have since been dropped.

“Africa is on the move. Africa is one of the fastest growing regions in the world,” Mr Obama told a conference on Saturday.

“Entrepreneurship offers a positive alternative to the ideologies of violence and division that can all too often fill the void when young people don’t see a future for themselves,” he added.

He said government also needed to help by establishing the rule of law and curbing corruption, mentioning two issues often cited by businesses as major obstacles to investment.

Kenya’s economy is expected to grow by about 6 per cent this year.

The economy of Ethiopia, Obama’s next stop, is forecast to expand by more than 10 per cent, although human rights groups say Addis Ababa’s economic achievements are at the expense of free speech.