President Barack Obama on Thursday touted progress he said the United States and its allies had made in the military campaign against Islamic State, but warned that the militant group still can direct and inspire attacks.

The United States is leading a military coalition conducting air strikes against Islamic State in Iraq and Syria, where the group seized broad swathes of territory in 2014. It has succeeded in breaking Islamic State's grip on some towns, although it still controls its two de facto capitals, Mosul in Iraq and Raqqa in Syria.

The president, criticized for suggesting Islamic State was made up of amateurs, presented a more measured assessment on Thursday.

He said the last two years of the U.S.-led air and ground campaign have proved that the extremist group can be beaten in conventional military fights but that it has shown the ability to carry out damaging, small-scale attacks.

"I am pleased with the progress that we've made on the ground in Iraq and Syria," Obama told a news conference at the Pentagon after meeting with officials directing the campaign, but added: "We're far from freeing Mosul and Raqqa."While the campaign against Islamic State in Iraq, Syria and now Libya is making significant gains, the group is adapting, reverting to high-profile attacks and using the internet to recruit and train, and to encourage "lone wolf" attacks.

"They've seen the degree of attention they can get with smaller-scale attacks using small arms or assault rifles," Obama said. "The possibility of either a lone actor or a small cell carrying out an attack that kills people is real."

The United States must do a better job of disrupting Islamic State networks that can carry out attacks far from the group's bases in the Middle East, Obama said.

"Those networks are more active in Europe than they are here, but we don't know what we don't know, and so it's conceivable that there are some networks here that could be activated," he said, while warning against over-reacting to such attacks.

"How we react to this is as important as the efforts we take to destroy ISIL, prevent these networks from penetrating," he said, using an acronym for the group. "When societies get scared they can react in ways that undermine the fabric of our society."