When a Taliban commander defected to ISIL in northern Afghanistan a few months ago, his men and the foreign fighters he invited in started to enslave local women and set up a bomb-making school for 300 children, officials and residents said.
The mini-caliphate established six months ago in two districts of Jawzjan province marks a new inroad in Afghanistan by ISIL, which is claiming more attacks even as its fighters suffer heavy losses in Iraq and Syria.
Qari Hekmat, a prominent Taliban leader in Jawzjan, switched allegiance around six months ago, according to local people who have since fled, raising the movement's black flag over the local mosque and forcing residents to swear fealty to ISIL leader Abubakr Al Baghdadi.
"They started killing a lot of people and warned others to cooperate," said Baz Mohammad, who fled Darz Aab district after his 19-year-old son was recruited into ISIL at the local mosque.
ISIL in Jawzjan has now attracted the attention of US forces in Afghanistan, which will launch an offensive in the north in the next few days, US General John Nicholson said on Tuesday.
US air strikes and special forces have been pounding ISIL's main Afghan foothold in the eastern province of Nangarhar, but that has not prevented the extremist group from stepping up attacks.
ISIL has claimed at least 15 bombings and other attacks in Afghanistan this year, including two in Kabul last month, killing at least 188 people. The number of attacks is up from just a couple nationwide last year.
It is unclear whether the all the attacks claimed by ISIL were carried out by the group, or linked to its central leadership in the Middle East. Afghan intelligence officials say some of the attacks may in fact have been carried out by the Taliban or its allied Haqqani network and opportunistically claimed by ISIL.
Yet the sheer number of attacks plus the targeting of Shiite mosques, an ISIL hallmark, indicates the movement is gaining some strength, though their links to the leadership in the Middle East remain murky.
Some analysts see ISIL as an umbrella term covering groups of fighters in Nangarhar's mountains, armed gangs in northern Afghanistan and suicide bombers in Kabul. Little is known about what ties them together.
"ISIL in Afghanistan never was such a solid, coherent organisation, even from the beginning," said Borhan Osman, an International Crisis Group analyst.
In Jawzjan, ISIL State gained its pocket of territory in much the same way it did in Nangarhar - through defection of an established militant commander.
Hekmat's Taliban fighters had long held sway in Darz Aab and Qushtepa districts, with the Afghan government having little control, said residents who fled to Shiberghan, some 120 kilometres away.
But after he fell out with the central Taliban leadership and switched allegiance, his men were joined by about 400 ISIL-affiliated fighters from China, Uzbekistan, Tajikistan, Pakistan, Chechnya and elsewhere, according to Darz Aab's district chief, Baz Mohammad Dawar.
Foreign militants have long operated in the border areas of Afghanistan, and in Jawzjan they had typically moved from place to place, occasionally co-operating with the Taliban.
But once they came to stay, life changed for the worse, according to three families and local officials who spoke to Reuters, even by the war-weary standards of Afghanistan.
"ISIL took our women as slaves, or forcefully made them marry a fighter. The Taliban never did that," said Sayed Habibullah, a Darz Aab resident.
"The Taliban had mercy and we spoke the same language, but ISIL fighters are foreigners, much more brutal and barbaric."
The fighters also forced some 300 children into ISIL training.
"In the school, ISIL allocated two classes for the children to learn about guns and bombs," said Ghawsuddin, a former headmaster in Darz Aab who, like many Afghans, goes by one name.
ISIL emerged in Afghanistan more than two years ago, when members of the Pakistani Taliban swore allegiance to the relatively new extremist movement that at the time had seized vast swathes of Iraq and Syria.
By June 2015, newly ISIL-aligned fighters had crossed into Afghanistan and seized around half a dozen districts in Nangarhar, scorching Taliban poppy fields and forcing them to flee.
Soon after, US forces began air strikes and dispatched special forces to assist Afghan troops in fighting ISIL.
Gen Nicholson, the commander of Nato-led forces in Afghanistan, said on Tuesday that some 1,400 operations had been conducted against ISIL since March, "removing over 1,600" from the battlefield and cutting off their outside finance and support.
"Daesh has been unable to establish a caliphate in Afghanistan," Gen Nicholson said, adding, "We see no evidence of fighters making their way from Iraq and Syria to Afghanistan, because they know if they come here they will face death."
Even if ISIL is not bringing in new fighters - though that remains a fear - it is another obstacle to Afghan security after 16 years of war against the Taliban.
"Whether it is ISIL or Taliban, they are our enemy," said Jawzjan police chief Faqir Mohammad Jawzjani. "And they have to be eliminated."