Afghan authorities are appealing to local elders in the remote eastern province of Nuristan to help prevent militants loyal to Islamic State from expanding into new territory.
The initiative comes as fighters and their families, scattered in recent months by U.S. and Afghan air strikes and special forces ground operations, seek new safe havens.
The mountainous and thickly forested province bordering Pakistan is seen by Afghan authorities as a potential new base for the self-proclaimed offshoot of Islamic State, whose desire to stoke sectarian tensions was underlined this year in a series of high-profile attacks.
With Afghan armed forces and their NATO allies already struggling to cope with the Taliban insurgency across much of the country, the prospect of an expanding Islamic State group has alarmed authorities and the U.S. military.
The group, generally known as Daesh in Afghanistan, has so far been largely confined to the eastern province of Nangarhar to the south of Nuristan. There is has clashed with other militant movements including the Taliban, who reject it.
Afghan intelligence officials say an intense campaign of air strikes and raids by Afghan and U.S. special forces in recent months also pushed many Islamic State fighters out of Nangarhar and into neighboring Kunar province, which borders Nuristan.
To prevent them moving further north, security officials said they had provided weapons, ammunition and other support to villages in Nuristan, while also tapping the province's particular culture to try to create a barrier against outsiders.
Hafez Abdul Qayum, the provincial governor, has held several meetings with local elders, who enjoy significant powers in a province where central government is weak.
On one recent trip, after a two-hour car journey along mountainous dirt roads, he and his entourage walked the final few hundred metres to the meeting place out of respect for local tradition.
There he sat down with elders young and old, many of them wearing round, woolen "pakul" hats and sporting beards dyed orange, to share a lengthy meal of seared goat meat and urge his hosts to oppose the new threat.
"Whether it is Taliban or Daesh, they both are the biggest misguided people and destroyers of our religious values," Qayum, himself from Nuristan, told elders in Wama district, close to Pech Valley in Kunar where Islamic State fighters have settled.
"Dear brothers, fighting against this menace is our biggest priority."
‘Valley of death’
Such outreach is not unusual in a country where the word of traditional leaders often counts for more than directives from central government.
And Nuristan, a province whose name means "the land of light" in Persian, has a history of repelling outsiders, including the Taliban and al Qaeda, by refusing them food and shelter and engaging in combat if necessary.
But Afghanistan's security forces see Islamic State as a fresh menace, because by targeting the minority Shi'ite community it risks making a dangerous insurgency led by the Taliban even harder to contain.
Last month, more than 30 people died in a suicide bombing claimed by Islamic State at a Shi'ite mosque in Kabul. Nuristan is seen as a natural buffer, with its singular culture, rugged mountain ranges and lack of paved roads or electricity.
Known as "Kafiristan", or "land of infidels", before its people were converted to Islam in the 19th century, it has an economy partly based on barter and local languages and dialects unrelated to the main languages of Afghanistan, Pashto and Dari.
That has made it difficult for the central government to exert control, and only a few thousand lightly armed police and one army unit are stationed there.
The real power in Nuristan is widely considered to be the "Qaomi Shura", or local elders' council.
"If they say to someone 'die', that person dies. This is the power of the council," said a senior government official in the provincial capital Parun.
If elders can be persuaded not to allow Islamic State to settle, security officials believe they will have a better chance of stopping its fighters from crossing from Pech Valley, where the Taliban and al Qaeda are also established.
Officials say Islamic State fighters from different countries have found sanctuary in a part of Kunar that includes an area known by U.S. troops as "The Valley of Death", where they have lost dozens of soldiers.
Al Qaeda's presence was underlined in October, when a U.S. airstrike killed Farouq al-Qatari, the movement's top commander in the east.
So far, Islamic State's presence is contained, as it finds its place in an area hotly contested by other militant groups, and locals have been warned against giving help. But it has the potential to grow.
"They moved in with their families some months ago and only appear in mosques and do not roam around very often," said one official in Kunar, who spoke on condition of anonymity because he is not authorized to speak to the media.
"They are trying to win local support and recruit young boys, the same method they used when they emerged in Nangarhar."
‘We don’t want misery’
The United States, which has a counterterrorism operation in Afghanistan distinct from the NATO-led Resolute Support training mission, calls Islamic State there "operationally emergent", well able to order deadly high-profile attacks on civilian targets but posing a limited military threat.
Regular drone strikes and special forces operations have hit it hard this year.
General John Nicholson, the top U.S. commander in Afghanistan, has said that Islamic State suffered heavy casualties, with 12 top leaders killed and two dozen command and control facilities destroyed.
From nine districts, it now had sanctuary in only three. However, Afghan officials fear the Islamic State offshoot, which they say is made up partly of extremists from neighboring Pakistan, could grow if fighters are pushed out of Iraq and Syria.
Although Nuristan has been historically peaceful, fighting has been going on for weeks in one district, with villagers and policemen repelling Taliban attacks.
An unstable environment could allow militant groups to establish themselves in places where they would typically be shunned, officials fear.
Afghan officials also worry that religious affiliations could push some people in Nuristan to help Islamic State fighters by providing food or shelter.
In Wama district, most residents are moderate Salafi followers, sharing an ideology similar to Wahhabism, the school of Sunni Islam from which Islamic State draws its religious ideology.
Taliban insurgents mainly follow the Hanafi school of Sunni Islam.
So far, locals have been quick to reassure visiting officials that such links will not influence them, possibly aware that Islamic State militants are likely to attract air and ground operations by Afghan and Western forces.
"Here there is no place for Taliban or Daesh fighters. We don't want destruction and misery for our people," said Sheikh Gul Mohammad, an influential tribal figure.