The Islamic State group will probably continue to be a threat to the US even after it is ousted from key strongholds in Iraq and Syria, Barack Obama has said.
The president warned that that lone-wolf believers will still be inspired to launch attacks that are hard to detect and prevent.
Speaking to reporters after meeting his national security advisers in the Pentagon, Mr Obama said the US has to do a better job disrupting terror networks and intercepting the internet messages that can get to troubled individuals and inspire them to act.
"What ISIL has figured out is that if they can convince a handful of people or even one person to carry out an attack on a subway, or at a parade or some other public venue, and kill scores of people as opposed to thousands of people, it still creates the kinds of fear and concern that elevates their profile," Mr Obama said.
He said terrorism will probably not be eliminated by his administration or his successors, and he is always pushing his team to seek out new ideas to battle the problem.
"I haven't gotten numb to it. It bugs me whenever it happens," he said.
But he added: "I do think that because of our extraordinary efforts the homeland is significantly safer than it otherwise would be."
'Islamic State' has claimed responsibility for a number of recent mass killings, including the Bastille Day attack in Nice, France, last month that left more than 80 dead, and the Orlando, Florida, nightclub shootings that killed 49.
While they may not have been directed by the group, the attackers were reportedly inspired by IS.
Mr Obama has beefed up the US military fight against 'Islamic State' in Iraq and Syria, recently authorising more troops to help Iraqi forces prepare to take back the northern city of Mosul, which has been under 'IS' control since 2014.
And this week the US expanded its campaign against the group with a new front of air strikes in Libya, to help the fledgling government there take back the city of Sirte.
The group, however, still maintains strongholds in the region, and the fight in Syria has bogged down.
Yesterday, however, Mr Obama said the anti-'IS' campaign is making progress in Iraq and Syria, because the group has not regained the territory it has lost in recent months.
But he noted that ousting the terror group from Mosul, and from its headquarters in Raqqa, Syria, will not eliminate its networks or its ability to encourage the smaller, more individual attacks.
He said: "It is so important for us to keep our eye on the ball and not panic, not succumb to fear, because ISIL can't defeat the United States of America or our Nato partners."
The US and its allies must "keep on grinding away" against the group, and take key operatives off the battlefield, and "eventually we will win".