Its troops had played a key role in weakening the al-Qaeda-linked al-Shabab group in Somalia, Mr Obama said.
He was speaking after talks with Ethiopia’s PM Hailemariam Desalegn, during the first ever visit by a US president to the East African state.
He also called on Mr Hailemariam to improve Ethiopia’s record on human rights and good governance.
“I don’t bite my tongue too much when it comes to these issues,” he said at a joint press conference in the capital, Addis Ababa.
Some rights groups have criticised Mr Obama’s visit, warning that it could lend credibility to a government accused of jailing journalists and critics.
A legal case currently being fought through the US courts alleges that agents of the Ethiopian government eavesdropped on the internet activities of a man in the US state of Maryland.
The man, born in Ethiopia and now a US citizen, works for a political opposition group outlawed in his home country.
Addressing the media, Mr Obama described the Ethiopian government, which won all parliamentary seats in May’s election, as “democratically elected”.
Opposition group have said the poll was rigged.
Mr Hailemariam said Mr Obama’s visit had taken a century-long relationship with the US to a “new height”.
“Our commitment to democracy is real, not skin-deep,” he added.
Answering a question about press freedom, Mr Hailemariam said Ethiopia wanted “civilised journalism”, and not reporters linked with “violent terrorist groups”. –BBC