U.S. Army General John Campbell, the outgoing commander of coalition forces in Afghanistan, estimates the number of ISIS militants in Afghanistan to range from 1,000 to 3,000 and warns that “they have the ability to recruit quite well, not only around the world, but inside Afghanistan.”

While the number is only a tiny fraction of Taliban forces in Afghanistan, the group’s presence is a source of concern and another reason to seek a peace agreement with the Taliban.

ISIS announced its existence in Afghanistan on January 26, 2015. It named the former Pakistani Taliban chief for Orakzai, Hafiz Saeed Khan, as head of ISIS’s “Khorasan Province,” a historic name for a region that encompassed Afghanistan, Pakistan and Central Asian countries.

The group established an FM radio station, "Voice of the Caliphate," in Nangarhar province in eastern Afghanistan to promote recruitment and disseminate propaganda. A U.S. air strike destroyed the station on February 1.

ISIS attacked the Pakistani consulate in the eastern city of Jalalabad on January 13 and killed several members of the Afghan security forces. Also in January this year, a suicide bomber killed an anti-ISIS-Khorasan tribal leader in Jalalabad along with a number of other people. The Taliban denied they were behind the bombing and evidence pointed toward ISIS.

Both the Afghan government and the U.S.-led coalition regard ISIS as a serious threat, but the Taliban have tried to downplay ISIS’ influence. In August 2015, a Taliban spokesperson, Zabiullah Mujahid, called the “ISIS rumor” in Afghanistan a pretext by the U.S. government and the CIA to invade Afghanistan.

Later, Mullah Akhtar Muhammad Mansour, the successor of the late Taliban leader Mullah Mohammad Omar, warned ISIS against starting a new fight in the country. He went on to say that the Taliban would defend their “achievements” in Afghanistan.

Non-Afghans seem to make up the majority of ISIS members in Afghanistan. Kunduz province in northern Afghanistan has always been a major gateway to Central Asia and a merge point for different extremist groups.

Afghan recruits appear to be motivated by opposition to the post-Omar Taliban leadership or tribal rivalries. Money is also being used as an incentive for some poor and desperate youth to join ISIS.

The most effective ISIS members in Afghanistan are former Taliban leaders who were expelled from the Taliban or left because of differences with the leadership. Salafi Abdul Rahim Muslim Dost and Maulvi Abdul Qahar, stalwarts of Saudi-backed Taliban groups operating in Afghanistan’s Nuristan and Kunar provinces, are among this group.

The only Afghan insurgent leader who has called on his followers to support ISIS was former warlord Gulbuddin Hekmatyar, who used the announcement to gain much needed publicity. He later denied any support for ISIS.

Ideological conviction does not appear to be a major attraction for Afghans. While both ISIS and Taliban are Sunni Muslim groups, they follow different jurisprudences. ISIS is Salafi with a literalist, strict and puritanical interpretation of Islam. The Taliban are Hanafi, and thus slightly more flexible in Islamic law, including treatment of non-Muslims.

Unlike ISIS, the Taliban has had little interest in a global jihad. They also respect Islamic holy sites—although not pre-Islamic monuments such as the Bamyan Buddhas, which they destroyed in 2001—and have sought to attract members from other Muslim sects. While the Taliban oppressed Shiites during their rule in the 1990s, there were no systematic genocides similar to that of ISIS in Syria and Iraq. In fact, Hazara Shiites have recently sought help from the Taliban to confront the ISIS threat.

The Taliban has created a special force of about 1,000 men to confront ISIS, but the challenge appears to be more political than military, as ISIS threatens to exploit the fallout from Omar’s succession.

The emerging threat of ISIS in Afghanistan has added urgency—for both the Kabul government and the Taliban—to the need for a peaceful settlement to the current conflict. ISIS has proven effective at moving into spaces of conflict and chaos, and manipulating such situations to expand their foothold.

Initial optimism over peace negotiations has waned as the Taliban has continued attacks to expand territory. The negotiations are also undermined by deep rifts within the group and the weakness of the Kabul government.

Regional powers all have an interest in making sure that ISIS is defeated in Afghanistan. Pakistan is already engaged in fighting extremists and an ISIS expansion would inflame the insurgency in Pakistan’s tribal regions even more. Pakistan would also have little ability to use ISIS as a proxy; Pakistani influence in Afghanistan would diminish if ISIS defeated the Taliban.

China and Russia also have an interest in defeating ISIS in Afghanistan. ISIS has attracted members from extremist groups including Hizb at-Tahrir, or the Party of Liberation, which is active in Uzbekistan, the Islamic Movement of Uzbekistan, the Islamic Movement of Tajikistan, some Chechen groups, and Uighurs from China.

President Vladimir Putin claimed last year that ISIS is present in “25 out of 34” provinces of Afghanistan.

Iran is also taking the threat of ISIS very seriously. Iran’s Interior Ministry recently published a report on the activities of ISIS sympathizers in Kurdish areas. The report warned that, considering the Sunni majority in certain provinces, the slightest mistake by provincial authorities could create a “domino effect.”

The report also asserted that because of Internet recruitment, “many Iranian Salafi Kurds are prepared to join them (ISIS) in Iraq and many have gone to Syria to join them.” Thus, the United States would find crucial international support for an Afghan peace process if it prevented ISIS from establishing a formidable presence in the war-torn country.

Nevertheless, there are factors that limit ISIS expansion in Afghanistan, including cultural and language differences. ISIS does not have the luxury of local support that the Taliban enjoyed in 1990s when they rose to power. Desperate Afghan residents, who had experienced years of destructive civil war, then welcomed the rise of Taliban. Afghanistan’s current security condition, as fragile as it is, cannot be compared with the 1990s.

Still, successful peace negotiations that resolve the Taliban fight with the Kabul government are required to blunt the ISIS threat. Many people have lost confidence in the Kabul leadership because of mounting economic hardship, institutionalized corruption and deteriorating security. If international forces leave the country without a peace settlement, it would create a dangerous power vacuum for ISIS to exploit. Talking with the Taliban might be the only option to prevent a worse scenario.