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.
“We’re worried as the campaign in eastern Syria and Iraq winds down, we’ll continue to see fighters move into” Libya and northern Africa, Mike Pompeo, the C.I.A. director, said at a security conference at the University of Texas this month.
Western counterterrorism and intelligence officials warn that even if the volume of fighters returning to the West has so far been relatively small, tracking them remains essential to preventing attacks.
“It only takes one or two fighters to slip through the cracks back to Europe — armed with militant knowledge or even instructions by their handlers — to wreak havoc and bring ISIS back to the TV screens,” said Laith Alkhouri, a director at Flashpoint, a business risk intelligence company in New York that tracks militant threats and cyberthreats.
That cold reality is pressuring European politicians and policymakers to erect or strengthen the legal frameworks and institutions needed to identify, arrest, prosecute and imprison foreign fighters before they can build new networks or join existing ones, wherever they end up.
After much criticism prompted by the Paris and Brussels attacks that European intelligence and law enforcement agencies were not cooperating with each other, those organizations have made significant improvements — with considerable United States help — in identifying and tracking fighters who have returned, American and European officials say.
As for the attackers in France and Belgium, “that cell is largely gone, but there are still pieces to be found,” Manuel Navarrete, chief of the European Counterterrorism Center, said in an interview here at the headquarters of Europol, an intelligence-sharing arm of the European Union.
European intelligence services, along with Interpol, have created major new databases of suspected foreign fighters; European spy agencies and Europol have also created counterterrorism hubs in the Netherlands for sharing information and mapping out strategy.
And a classified American military program in Jordan called Operation Gallant Phoenix is scooping up data collected in commando raids in Syria and Iraq and funneling it to law enforcement agencies in Europe and Southeast Asia. “That’s our intelligence- and information-sharing architecture,” Gen. Joseph F. Dunford Jr., the chairman of the Joint Chiefs of Staff, said in describing the program to Congress in June.
Despite these advances, homegrown or inspired jihadists who have never traveled to war zones remain perhaps the largest threat.
“The continuing efforts of ISIL followers in Europe to conduct attacks demonstrate the potential for ISIL to recruit and motivate followers in Europe,” said a United Nations report in August. “Those attacks involved both individuals who were prevented from traveling to the conflict zones and individuals who had no prior intention to travel.”
Several American and European officials also voiced concern about Turkey, a country that has the trappings of a modern state but where the Islamic State has been allowed to operate almost unchecked, until recently.
In an aborted plot in Australia this summer, parts of a roadside bomb were sent through international air cargo from Turkey through Islamic State operatives in Syria to one of the suspects in Australia. The suspects planned to assemble the explosive device into a bomb to be placed on the plane, but the plot was disrupted.
Even as Turkish authorities have increased security along their border with Syria, the center of gravity of foreign fighters is shifting to Turkish cities like Sanliurfa and Gaziantep, where the Islamic State has carried out executions of Syrian activists and journalists with what appears to be impunity.
If the Islamic State fighters regroup in Turkey, they can return in small groups to Europe or elsewhere via the old refugee route, which is less fluid than it was but still penetrable. A Belgian was recently arrested in Turkey, suspected of plotting a terrorist attack there, after spending years in Syria.
Some fighters leaving conflict zones seem to have been briefed in detail on how to act when they encountered government authorities, in an apparent attempt to ensure that they would not be deported to countries where they may be arrested, the United Nations report noted. That might indicate a deliberate attempt by Islamic State leaders to establish a presence in different regions, the report concluded.
The report said people returning from these conflict zones fell into three broad categories: First, those who were disenchanted by their experiences in Iraq or Syria and were good candidates to be reintegrated into society.
Second, a much smaller group who return intending to conduct terrorist attacks. And third, individuals who have cut ties with the Islamic State and are disillusioned by the organization, but who remain radicalized and are ready to join another terrorist group should the opportunity arise.
“It is an incredibly difficult adversary,” Mr. Pompeo said at a security conference in Washington last week. “They still have the capacity to control and influence citizens all around the world.”