French and Algerian fighters, some arriving from Syria, have joined the ranks of ISIL in northern Afghanistan where the militants have established new bases, multiple international and Afghan sources have said.
It is the first time that the presence of French ISIL fighters has been recorded in Afghanistan, and comes as analysts suggest that foreigners may be heading for the country after being driven from Syria and Iraq.
It is also a troubling sign as France, which has faced the worst of the ISIL-inspired violence in Europe since 2015, debates how to handle hundreds of its citizens who went to fight for the group in the Middle East.
A number of Algerian and French nationals entered the largely ISIL-controlled district of Darzab in the northern province of Jowzjan in November, said district governor Baaz Mohammad Dawar.
At least two women were among the arrivals, who were travelling with a translator from Tajikistan as well as Chechens and Uzbeks, Mr Dawar added.
European and Afghan security sources in Kabul confirmed Mr Dawar's claim that French citizens were among the fighters - though one cautioned: "We do not know how many there are."
Three of the Algerians seen in Darzab are believed to have been in Syria and Iraq, Mr Dawar said, suggesting they may link the ISIL affiliate in Afghanistan and Pakistan with the main group in the Middle East.
When it first emerged in 2015, the so-called Khorasan Province overran large parts of the eastern provinces of Nangarhar and Kunar, though initially its part in the Afghan conflict was overshadowed by the Taliban.
The militants have since spread north, including in Jowzjan on the border with Uzbekistan, and carried out multiple devastating attacks in the capital, Kabul.
Mohammad Raza Ghafoori, the Jowzjan provincial governor's spokesman, said French-speaking Caucasian men and women had been seen training ISIL fighters in Darzab.
He cited reports saying that around 50 children, some as young as 10, have also been recruited by the fighters.
Darzab residents said roughly 200 foreigners had set up camp just a few hundred metres from the village of Bibi Mariam.
One local man who gave his name as Hajji said the fighters were of several nationalities, including French, and were tall, aged in their late 20s, and dressed in military clothing.
"They ride their [motor] bikes, go to the border and come back, but they talk to nobody," he said.
Hashar, a former district village chief, said some were training others to use suicide bombs and lay mines.
"They are ... bringing misery to normal people," he said. Other villagers added that many residents had fled the area.
Locals along with Mr Dawar, the district governor, warned the fighters were also exploiting natural resources, such as precious stones and metals.
One of the security sources said two of the French militants had been nicknamed "The Engineers" and appeared to be organising some sort of extraction, "but we do not know what they are looking for".
Several European services believe the fighters are arriving through Tajikistan, the source said, adding that at least one Frenchman arrested there in July said he had wanted to join ISIL in Afghanistan.
Afghanistan has long attracted foreign fighters, from the mujaheddin during the 1980s war against Soviet invaders to Al Qaeda's later use of the country as a haven.
The Pentagon has said that ISIL militants in Afghanistan number fewer than 1,000.
But the growing presence of foreign fighters among them indicates that ISIL "seeks to create an external operations node for new waves of global attacks", warned analysts at the Washington-based Institute for the Study of War recently.
Aymenn Jawad Al Tamimi, an expert on extremist groups, said he did not think the presence of foreign fighters in Afghanistan meant that ISIL was necessarily "shifting its base".
The group's "natural home is Iraq and Syria, but I presume many of the foreigners in particular are taking the opportunity either to escape entirely or moving to other battlefields for IS where they might prove more useful," he said.
The head of US forces in Afghanistan, General John Nicholson, has vowed the group will be "annihilated", and Washington notoriously dropped the so-called "Mother Of All Bombs" on an ISIL stronghold in Nangarhar in April.
But as the number of fighters grows in Darzab, the villager Hajji saidthere were no signs of pro-government forces in the district.
"[The] government is God damned," he said. "There is no government here."