Image caption
A 21-gun salute greeted the US president as he arrived for the talks in Addis Ababa

On the security threat by al-Shabab, Mr Obama said there had been a "shrinkage" of the group since the deployment of regional troops to Somalia, its main base.

However, the killing of 15 people in a bomb attack on a hotel in Somalia's capital, Mogadishu, on Sunday was a reminder that "we have to now keep the pressure on", he said.

"We don't need to send our own marines in to do the fighting: The Ethiopians are tough fighters and the Kenyans and Ugandans have been serious about what they're doing."

Mr Obama flew to Ethiopia after a two-day visit to Kenya where he had discussed trade and security but also called for greater human rights and warned of the dangers of corruption.

At the scene: Karen Allen, BBC News, Addis Ababa

Image copyrightAFP

Compared to the Kenyan leg of his tour, President Obama's arrival in Ethiopia has signalled a more sombre mood. After talks in the ornate setting of the presidential palace, Mr Obama sought to highlight the areas of agreement with his host and tread cautiously over the delicate issue of democratic rights.

He praised Mr Hailemariam for the country's contribution to peacekeeping efforts in the region, and said the US wanted to help "sustain momentum" on Ethiopia's impressive rates of economic growth. Addis Ababa has undergone a massive building boom, thanks in part to substantial Chinese investment

But on the thorny issue of press freedom, much still divides the pair. Mr Obama said it was a "significant topic of discussion", and insisted that a vibrant and free press would strengthen rather than inhibit Ethiopia's development. For his part, the prime minister called for "civilised journalism" and said Ethiopian journalists needed training.

Mr Obama also referred to the civil war in South Sudan ahead of talks with regional leaders on the issue.

Government and rebels leaders were "extremely stubborn", and other "tools" would have to be considered if there was no breakthrough in ending the conflict, he added.

The 19-month war in South Sudan has left thousands of people dead and displaced more than two million.

On Tuesday, Mr Obama will also be the first US leader to address the 54-member African Union in Addis Ababa.