Barack Obama has admitted the US does not yet have a "complete strategy" against Islamic State (Isis) and that the training of Iraqi forces would have to be accelerated.
"They're nimble, they're aggressive and they're opportunistic," Obama said of the jihadist group, which seized large swaths of Iraq and Syria last year.
He expressed confidence that the group would ultimately be defeated.
"We have seen successes but we have also seen setbacks," he said. "We are going to be successful. IS is going to be driven out of Iraq and it is going to be defeated."
He said that the US does not yet have a "complete strategy" for defeating IS, and stopping the flow of foreign fighters to the group would be essential.
The comments come after a small group of IS fighters ousted an Iraqi army contingent from provincial capital Ramadi last month. Over the weekend, IS was ousted from the oil refinery town of Baiji by Iraqi government forces supported by Shia militants.
Of plans to speed up the training of Iraqi forces, he added: "We're reviewing a range of plans for how we might do that, essentially accelerating the number of Iraqi forces that are properly trained and equipped." He was speaking on the sidelines of the G7 summit in Bavaria, Germany.
Obama spoke after a meeting with Iraqi Prime Minister Haider al-Abadi.
Abadi thanked G7 members for standing with Iraq against IS, and downplayed the loss of Ramadi.
"We lost it only temporarily," he said.
Obama expressed confidence in Abadi's leadership, and stressed the importance of creating an inclusive Iraqi government, in which all of Iraq's factions were represented.