The Islamic State group, or Daesh as it is known in Afghanistan, has killed hundreds of people in multiple attacks across the country since it first emerged in the region in 2014.
In the past 18 months, as a US-led bombing campaign against the group gathered momentum, it dramatically escalated its attacks in Kabul, adding to the dangers already faced by civilians in the city, which the UN cites as one of the deadliest places in the country.
Here are some key moments in the rise of the Middle East jihadist group in Afghanistan.
The Islamic State group first emerged in Afghanistan in 2014 as NATO combat troops withdrew from the country and handed over responsibility to Afghan security forces.
IS militants initially overran large parts of eastern Nangarhar and Kunar provinces, near the Pakistan border, where they engaged in a turf war with the Taliban.
But for months US and Afghan officials debated whether IS fighters were the real deal or just Taliban turncoats.
Asked about the presence of IS in Afghanistan in February 2015, then Pentagon chief Ashton Carter played down the threat, saying some Taliban insurgents were making an attempt at “rebranding” themselves.
“The reports I’ve seen still have them in small numbers and aspirational,” he said.
Two months later IS claimed its first major attack in Afghanistan after a suicide bomber killed and wounded scores of people in Nangarhar.
A UN report written in the summer of 2015 warned IS was making inroads in Afghanistan, winning over a growing number of sympathisers and recruiting followers in 25 of the country’s 34 provinces.
Any lingering doubts about the presence of IS in Afghanistan were quashed in January 2016 when the US State Department formally designated the group’s affiliate in Afghanistan and Pakistan — which calls itself “Khorasan Province” — as a terrorist organisation.
The name Khorasan refers to a historic region which includes parts of modern-day Afghanistan, Pakistan and neighbouring countries.
First strike in Kabul
After carrying out multiple attacks across Afghanistan, IS claimed its first assault in Kabul in July 2016 — one of its deadliest assaults in the Afghan capital to date.
Twin explosions ripped through crowds of Shiite ethnic Hazaras, killing at least 85 people and wounding more than 400.
That was followed by two more attacks also targeting the minority Shiites in October and November, fuelling fears of sectarian violence in the country.
In April 2017 the US military dropped the so-called Mother Of All Bombs on IS hideouts in a complex of tunnels and bunkers in eastern Nangarhar province, killing more than 90 militants.
The Pentagon said the GBU-43/B Massive Ordnance Air Blast device was the biggest non-nuclear weapon it had ever used in combat.
US forces in Afghanistan continued to target the group, killing its head Abu Sayed and several senior advisers in a July 11 strike in Kunar, the Pentagon has said.
But IS militants have since spread north, including in Jowzjan on the border with Uzbekistan.
They have also stepped up the pressure in Kabul, carrying out at least 14 attacks against Afghan security forces and Shiites over the year and establishing cells made up largely of middle-class Kabul residents in the war-torn capital.