Islamic State militants who were killed during an attack in March were buried in unmarked graves in Ben Guerdane, Tunisia. (Lorenzo Tugnoli/for The Washington Post)

The flow of foreign fighters to the ranks of the Islamic State — once a mighty current of thousands of radicalized men and women converging on Syrian and Iraqi battlefields from nations across the globe — has been cut to a trickle this year as the group’s territory has shrunk and its ambitions have withered.

The decline, officials and experts say, has been dramatic, prolonged and geographically widespread, with the number of Europeans, Americans, North Africans and others joining up to fight and die for the idea of a revived Islamic caliphate falling as precipitously as the terrorist group’s fortunes.

From a peak of 2,000 foreign recruits crossing the Turkey-Syria border each month, the Islamic State and other extremist groups operating in Syria are down to as few as 50, according to U.S. intelligence assessments.

Governments from Britain to Tunisia say their citizens are less likely than they have been in years to heed the Islamic State’s calls for front-line volunteers.

Diminished flows deprive the organization of needed reinforcements and further erode its ability to cast itself as the rebirth of a vast Islamic empire. But they also raise questions about whether the terrorism threat is actually easing or just morphing into a more dangerous new phase.

Libyan forces say they've taken back almost all of Sirte, a city that used to be Islamic State's regional stronghold. (Reuters)

“It’s a massive falloff,” said Peter Neumann, director of the International Center for the Study of Radicalization at King’s College London. “And it’s basically because Islamic State is a failing entity now. The appeal of Islamic State rested on its strength and its winning. Now that it’s losing, it’s no longer attractive.”

The sustained decline marks an important milestone in global efforts to defeat the Islamic State, reflecting measures ranging from a multinational military campaign to, in at least one nation, rules requiring parental permission slips before young men can leave the country.

[10 new wars that could be unleashed as a result of the one against ISIS]

But Neumann and others said the decline in Islamic State recruiting figures — which has come almost as quickly as the rise following leader Abu Bakr al-Baghdadi’s declaration of a caliphate in June 2014 — is hardly an unmitigated success for the United States and its allies.

Instead, it may be the beginning of a new stage, one in which would-be fighters choose to carry out attacks at home rather than travel abroad, and battle­hardened veterans seek out new lands for conflict.

“It’s like after the Afghanistan war in the 1980s,” said Neumann, citing the period after Soviet troops withdrew in 1989 and legions of foreign fighters formed a diaspora of radicalized veterans that subsequently fueled the rise of al-Qaeda. “They’ll be asking themselves, ‘What’s next?’ ”

That peril helps explain why U.S. and other officials have been cautious in trumpeting the declining foreign-fighter numbers.

The Turkish army carries out controlled explosions in Syria's Jarabulus just across the border from Turkey on Thursday, removing mines and booby traps left by Islamic State. (Reuters)

French Interior Minister Bernard Cazeneuve announced this week that there was “a fourfold decrease” in the number of French citizens who have traveled to the Islamic State’s domain in the first six months of 2016, compared with the 69 fighters who did so over the same period last year.

Rather than celebrate, however, French officials have been bracing the public for what could happen if some among the almost 700 French citizens or residents who are still fighting in Syria and Iraq decide it is time to come home.

“Their return represents an additional menace for our national security,” said French Prime Minister Manuel Valls, whose country has been hit by repeated terrorist attacks in the past two years.

One European law enforcement official said that although the number of people departing for Syria has been dropping, the security threat may simply be changing, not diminishing.

“If you look at one side, fewer people leaving would also mean fewer people getting radicalized and also being passed out from Syria and Iraq to commit attacks,” said Wil M. van Gemert, the head of the operations department at Europol, the European Union law enforcement agency.

“But if you look at the summer, you see what kind of attacks we’ve had,” he said, listing incidents in France, Germany and Belgium. “We had people who had been radically inspired, and IS took a position where they claimed them to be their soldiers,” he said, using an abbreviation for the Islamic State, which is also known as ISIS or ISIL.

In many cases, however, the Islamic State’s connections with those attackers were tenuous at best.

And as the group fights for its survival amid a U.S.-led assault from the air and Turkish, Kurdish and Iraqi military offensives on the ground, the Islamic State has struggled to draw significant numbers of new foreign fighters under its direct control.

Spiral of decline

As of December, up to 31,000 people from at least 86 countries had traveled to Syria or Iraq to fight alongside the Islamic State or other extremist groups, according to a comprehensive analysis by the Soufan Group, an international security consulting firm.

The extraordinary flows — outpacing those from all other recent conflicts — gave the Islamic State a virtually unending supply of fighters with which to battle the group’s myriad enemies. Even more important than battlefield ranks, however, was the propaganda value of an army that matched the scope of the group’s rhetoric, which called for a global Muslim uprising against infidel regimes.

But since late last year, amid a succession of battlefield losses, that has become a harder case to make as the flows have sharply slowed, creating a self-reinforcing spiral of decline.

The ranks of new fighters have diminished so dramatically that certain countries, such as Belgium and Britain, have not even increased their estimates this year of the number of citizens who have left home to fight.

Olivier Van Raemdonck, a spokesman for Belgium’s Coordinating Unit for Threat Analysis, the country’s main terrorism tracking body, said that Belgian authorities have received information about a few people departing this year but that they have not been able to confirm such tips. Belgium has had the highest per-capita flow of foreign fighters to Syria of any European country. But now “an entire channel has been shut down,” Van Raemdonck said.

In the United States, which has been a far less significant source of fighters than many European nations, the average number of Americans traveling to fight for the Islamic State in Syria dropped from six to 10 per month during the first half of 2015 to just one a month, FBI Director James B. Comey said in May. He cited the group’s lost luster as the cause.

“ISIS, the so-called Islamic State brand, has lost significant power in the United States,” he said.

[For the first time since 2013, ISIS has no border with NATO]

The group’s reduced international cachet is not the only explanation for the lower numbers. The increasing difficulty of traveling to Islamic State-held territory also has hurt recruitment figures, experts and officials say.

Dramatically stepped-up restrictions, including tanks lined up at 50-yard intervals in some places where fighters are known to cross and walls and ditches constructed in others, have made it far harder to infiltrate along the favored path into Islamic State terrain: the Turkey-Syria border.

Late last month, the group lost its last remaining foothold on that border, cutting off a valuable conduit through which recruits had long passed. “We expect this development to have a positive impact” on further reducing the flow of foreign fighters, said a senior Turkish official who spoke on the condition of anonymity.

Enhanced intelligence-sharing between Turkey and Western governments also has helped to make what was once a relatively easy journey from Europe to Syrian battlefields far more difficult. The Turkish government says it has added more than 40,000 names to its no-entry list based on intelligence supplied by foreign governments in the past 1½ years, compared with fewer than 5,000 names in 2014. The rise has been accompanied by a sharp increase in the number of deportations, as Turkish authorities intercept would-be fighters and send them home.

The lack of fresh Islamic State manpower is evident on the battlefield. Brig. Gen. Yahya Rasoul, a spokesman for the Iraqi military, said the group has begun to recruit children to plug the gap as adult militants are killed and foreigners leave for Syria or home.

“There is big confusion in their ranks,” said Rasoul. Whereas the Islamic State once used foreign fighters as suicide bombers, it is increasingly tapping young Iraqi boys, he said.

Besieged senior Islamic State officials have begun to acknowledge that there will be no cavalry coming to bolster their ranks.

[In potential blow to propaganda power, Islamic State reports death of senior leader in Syria]

In his last speech before he was killed in an airstrike last month, spokesman Abu Muhammad al-Adnani alluded to the increasing problems facing foreigners wishing to travel to Islamic State territory. He also issued the sort of threat that explains why Western security officials fear that ­extremist-fueled attacks will not end just because access to the battlefields of Syria and Iraq has been restricted.

“If the tyrants have closed in your faces the door of hijrah [migration], then open in their face the door of jihad and make their act a source of pain for them,” he said in a late-May audio recording. “The smallest action you do in the heart of their land is dearer to us than the largest action by us, and more effective and more damaging to them.”

He urged his followers to strike civilian rather than military targets, as hitting the former is “more damaging.”

Reverse flows

Overstretched European security agencies remain ill-prepared to deal with the consequences if that call is heeded by Islamic State sympathizers, or if the flows start to reverse and fighters return home in large numbers.

“It’s a five-letter word, and it’s called intel,” said François Heisbourg, a former member of a French presidential commission on defense and national security. “The only thing you can seriously do is to ramp up the ability to track and keep track of those who are here and those who are coming here.”

In Germany, where the flow of foreign fighters to Syria has been cut from an average of dozens a month to a small handful, the head of the Federal Criminal Police Office, Holger Münch, recently told the Berlin daily Der Tages­spiegel that those who “have already spent a long time with IS, have been exposed to brutal war experiences and established many contacts” represent “a special threat” to German security if they return.

Concern over a reverse flow — or over extremists who decide to strike at home rather than go abroad — is hardly limited to the West.

[Amateur terrorist attacks may mark a new chapter in the ISIS war in Europe]

In Tunisia, the source of the single largest contingent of foreign fighters to the conflicts in Syria and Iraq, the flows have declined as travel to the battlefields has become more difficult, according to officials and analysts. Among the new measures blocking the path of would-be recruits: All men under 35 seeking to travel outside Tunisia need written permission from their parents stating their purpose for leaving.

But the reduced flows have stoked growing worries that the problem of militant extremism will become even more pronounced domestically.

“The battle is shifting from Syria to North Africa,” said Badra Gaaloul, a researcher with the Tunis-based International Center of Strategic, Security and Military Studies.

“There are a lot of ISIS sleeping cells still active in Tunisia, so many that we call them ‘awake cells,’ ” said Gaaloul. “They want to start a caliphate in Tunisia.”

As evidence, Gaaloul cited the assault on the border town of Ben Guerdane by Islamic State militants this year, which Tunisian and regional officials say was an attempt to create a new safe haven as the group faces pressure in its Libyan stronghold of Sirte.

In recent days, senior Tunisian officials — who say there are still 4,000 countrymen fighting for the Islamic State and other extremist groups — have publicly expressed concern that Tunisian fighters fleeing Libya and Syria would return.

“The danger is real. Those who leave Sirte are heading south to eventually join Boko Haram, but some are also going west [to Tunisia],” the country’s defense minister, Farhat Hachani, told journalists, referring to the Nigerian militant group that has pledged support for the Islamic State.

Egypt, too, has seen reduced outflows, having paid off tribes along the Libyan border that run human-smuggling networks to block the path of would-be fighters, according to Mohannad Sabry, an Egyptian journalist and author of a book on the Islamist insurgency in the Sinai Peninsula.

But just because radicalized Egyptians are not formally linking up with the Islamic State does not mean they are not a threat, especially as the government feeds extremism by cracking down on its political opponents.

“The numbers are decreasing,” Sabry said, “but actually the number of wannabes is rising.”

Raghavan reported from Cairo and McAuley from Paris. Liz Sly in Beirut, Loveday Morris in Baghdad, Karla Adam in London, Stephanie Kirchner in Berlin, Michael Birnbaum and Annabell Van den Berghe in Brussels, and Matt Zapotosky in Washington contributed to this report.

Read more:

Islamic State, losing fighters and territory, increasingly turns to child bombers

Gallery: The remnants of war that ISIS fighters left behind

Today’s coverage from Post correspondents around the world