To be sure, the Islamic State, also known as ISIS or ISIL, still poses a threat to Western countries, perhaps chiefly in the form of militants who are inspired or enabled by the group to attack at home, as evidenced by the recent attacks in Britain and Barcelona, officials say.

But a combination of factors has suppressed the flow of militants returning from war zones. Many died after allied and local forces cut off most escape routes from Raqqa and Mosul. Since the terrorist attacks in Paris in 2015 and Brussels last year, European nations have tightened border security and increased surveillance. Others are believed to be bottled up in third countries like Turkey.

“I’ve been saying for a long time that there won’t be a ‘flood’ of returnees, rather a steady trickle, and that’s what we are seeing,” said Peter Neumann, director of the International Center for the Study for Radicalization at King’s College London. “Many of them are stuck in the Turkish border areas, where they are contemplating their next move.”

As it becomes harder for the Islamic State to plan attacks from Iraq and Syria, some plotters may have also moved to the Philippines or to Libya. The bomber who killed 22 people at a pop concert in Manchester, England, in May had met in Libya with members of an Islamic State unit linked to the Paris attacks, according to current and retired intelligence officials.