Despite years of military targeting by the US-led coalition, the group known as Islamic State Khorasan has survived to pursue new attacks as the United States and other NATO partners withdraw from Afghanistan, and as the Taliban return to power.
President Joe Biden cited the threat of Islamic State attacks in sticking with a Tuesday deadline for pulling US forces out of Afghanistan.
And ahead of deadly suicide bombings at the Kabul airport Thursday, there were urgent Western warnings of a potential attack by the group, under cover of the throngs that have gathered at the Kabul airport seeking evacuation.
US officials said the killings are believed to have been carried out by the Islamic State group.
The group has built a record of highly lethal attacks in the face of its own heavy losses.
A look at a deadly group influencing the course of the Kabul airlifts and US actions:
What is Islamic State Khorasan?
The Islamic State's Central Asia affiliate sprang up in the months after the group's core fighters swept across Syria and Iraq, carving out a self-styled caliphate, or Islamic empire, in the summer of 2014. In Syria and Iraq, it took local and international forces five years of subsequent fighting to roll back the caliphate.
The Afghanistan affiliate takes its name from the Khorasan Province, a region that covered much of Afghanistan, Iran and central Asia in the Middle Ages.
The group is also known as ISK, or ISIS K.
Who are the Islamic state Khorasan's fighters?
The group started as several hundred Pakistani Taliban fighters, who took refuge across the border in Afghanistan after military operations drove them out of their home country.
Other, like-minded extremists joined them there, including disgruntled Afghan Taliban fighters unhappy with what they — unlike the West — saw as the Taliban's overly moderate and peaceful ways.
As the Taliban pursued peace talks with the United States in recent years, discontented Taliban increasingly moved to the more extremist Islamic State, swelling its numbers.
Most were frustrated that the Taliban was pursuing negotiations with the US at a time when they thought the movement was on the march to a military win.
The group also has attracted a significant cadre from the Islamic Movement of Uzbekistan, from a neighbouring country; fighters from Iran's only Sunni Muslim majority province; and members of the Turkistan Islamic Party comprising Uighurs from China's northeast.
Many were attracted to the Islamic State's violent and extreme ideology, including promises of a caliphate to unite the Islamic world, a goal never espoused by the Taliban.
What makes them a leading threat?
While the Taliban have confined their struggle to Afghanistan, the Islamic State group in Afghanistan and Pakistan has embraced the Islamic State's call for a worldwide jihad against non-Muslims.
The Centre for International and Strategic Studies counts dozens of attacks that Islamic State fighters have launched against civilians in Afghanistan and Pakistan, including minority Shiite Muslims, as well as hundreds of clashes with Afghan, Pakistani and US-led coalition forces since January 2017.
Though the group has yet to conduct attacks against the US homeland, the US government believes it represents a chronic threat to US and allied interests in South and Central Asia.
What is their role with the Taliban?
They are enemies. While intelligence officials believe al-Qaida fighters are integrated among the Taliban, the Taliban, by contrast, have waged major, coordinated offensives against the Islamic State group in Afghanistan.
Taliban insurgents at times joined with both the US and US-backed Afghan government forces to rout the Islamic State from parts of Afghanistan's northeast.
A US Defence Department official, speaking to The Associated Press on condition of anonymity because he was working covertly, said previously that the Trump administration had sought its 2020 withdrawal deal with the Taliban partly in hopes of joining forces with them against the Islamic State affiliate.
The administration saw that group as the real threat to the American homeland.
What is the risk now?
Even when the United States had combat troops, aircraft and armed drones stationed on the ground in Afghanistan to monitor and strike the Islamic State, Islamic State militants were able to keep up attacks despite suffering thousands of casualties, Amira Jadoon and Andrew Mines note in a report for West Point's Combating Terrorism Centre.
The withdrawal is depriving the United States of its on-the-ground strike capacity in Afghanistan, and threatens to weaken its ability to track the Islamic State and its attack planning as well.
Biden officials say the Islamic State group is only one of many terror threats it is dealing with globally.
They insist they can manage it with so-called over-the-horizon military and intelligence assets, based in Gulf states, on aircraft carriers, or other more distant sites.
One of the United States' greatest fears about pulling out its combat forces after two decades is that Afghanistan under Taliban rule again becomes a magnet and base for extremists plotting attacks on the West.
That threat, US national security adviser Jake Sullivan told CNN last weekend, was something "we're focused on, with every tool in our arsenal."