The first formal reaction by Iranian officials was in the form of a statement by the Ministry of Foreign Affairs on March 1. It read in part, “The Islamic Republic of Iran believes lasting peace will be established in Afghanistan only through intra-Afghan talks attended by the country’s political groups, including the Taliban, while taking into account the considerations of Afghanistan’s neighboring countries.”

To no one's surprise, Iranian representatives were not invited to the signing ceremony or to the preceding 10 rounds of negotiations although actors of lesser importance in the Afghanistan sphere received invitations, such as Indonesia, Tajikistan, Turkey and Uzbekistan.

The “end,” however, will come with the United States practically handing the country back to the very group that triggered the war when it refused to hand over Osama Bin Laden in 2001 after the 9/11 attacks. In addition, many Afghans believe the agreement ignores their interests and preferences and sells out the Kabul government to Islamic militants for the sake of a US withdrawal as soon as possible. The Associated Press cited two anonymous sources as saying that Pompeo himself had been reluctant to attend the signing ceremony and that he only did so at President Donald Trump’s insistence. Putting aside whether the agreement will meet American or Afghan expectations, there is another valid question: What’s in it for Iran?

Advocates of these agreements believe they will pave the way for US and other foreign troops to gradually withdraw from Afghanistan within 14 months , heralding the end of the 18-year war that Doug Bandow of the Cato Institute has pointed out has lasted “longer than the Civil War, Spanish-American War, World War I, World War II, and Korean War combined.”

The month of February came to a close with a watershed event: The United States formally signed an agreement with the Taliban , the Islamist militant group it has been fighting in Afghanistan since October 2001. US Secretary of State Mike Pompeo met Feb. 29 with Taliban delegation leader Mullah Abdul Ghani Baradar in Doha, Qatar, and announced the agreement, which Baradar and veteran US diplomat Zalmay Khalilzad signed. The ceremony followed a “reduction in violence” agreement that took effect Feb. 21.

The complete Iranian statement seems confusing in desiring the withdrawal of foreign forces while at the same time opposing an agreement based on withdrawing all foreign forces. It also does not reveal the main concerns Iran has in terms of the dramatic transformations potentially ensuing inside Afghanistan. Tehran will be monitoring events apprehensively, not simply because it desires a US withdrawal from the war-prone country, but because of the unexpected consequences an unstable Afghanistan might have on Iranian national interests at the regional level in addition to the inevitable theological confrontations a dominant Taliban will generate in the future.

Geopolitically speaking, Afghanistan has all the characteristics of an “insulator state,” that is, a battleground for regional rivals that has segmented internal dynamics that preclude any one actor from establishing long-term authority and that at the same time is untethered from the security dynamics of its region. This has been a defining feature of Afghanistan since it broke away from Persia in 1747. Britain, the Soviet Union, Iran, Pakistan, China and Saudi Arabia all have taken advantage of this to wage their own classic and proxy wars in the country.

Although the United States was never able to prevail over all the other groups and opponents in Afghanistan since getting involved there in 2001, it did manage to establish itself as the dominant security producer within the country. This eliminated the activities of regional rivals on Afghan territory, including by Iran and its adversaries. When American troops exit Afghanistan, it is highly likely that the situation from pre-2001 will reemerge.

In that case, Iran’s political system will be saddled with another burden draining its political, diplomatic and economic resources, which are already scarce given its involvement in various regional crises. Also, a US exit would leave Iran and Pakistan to once again directly confront each other. Prior to the 2001 US-led invasion, Iran and Pakistan were deep into a proxy war in Afghanistan, with the Iranians funding the Afghan Northern Alliance against the Pakistani-backed Taliban. A return to that scenario would be unfortunate for Iran for several reasons.

Pakistan, though it has recently stepped in to try to calm tensions between Iran and Saudi Arabia, has not been completely neutral in this rivalry. Thus renewed disagreement over Afghanistan would obviously not be helpful. Also, the US-Taliban agreement simply means the United States is leaving Afghanistan in the hands of the militants, a Sunni-Pashtun group that enjoys close ties to Pakistan’s Inter-Services Intelligence agency. This means that Iran will not only concede influence to Pakistan, it will also need to seek an agreement with an Afghan government expected to be under the Taliban’s influence. The Tajik and Hazara in Afghanistan are Iran’s longstanding allies, and a Taliban-Iranian agreement would be at their expense. The two groups already hold it against Tehran for adopting an appeasement policy toward the Taliban in recent years and believe that Iran has given up on them for the sake of easing relations with the Taliban and countering the Islamic State in Afghanistan.

The Taliban's presumed dominance has strategic implications beyond those for Iran. The agreement with the United States doesn’t commit the group to anything in regard to future political arrangements in Afghanistan. The deal solely focuses on ensuring that Afghan territory will not be used against the interests of the United States and its allies. It does require the Taliban to enter into negotiations with the Kabul government, but that’s it.

It doesn’t obligate the Taliban to accept or comply with any particular political system, and it doesn’t entail the Taliban disarming or forgoing the imposition of an Islamic emirate through negotiations. The agreement affirms several times that the document is a concordant between “the United States and the Islamic Emirate of Afghanistan, which is not recognized by the United States as a state.” Ironically, one section of the three-page agreement says that the Taliban will not “provide visas, passports, travel permits or other legal documents to those who pose a threat to the security of the United States and its allies,” tasks that are functions of a recognized state.

The United States knows that the Taliban will control Afghanistan. In this regard, the agreement is like leaving a wolf to care for the sheep. There is a good chance the Taliban will try to change the current constitution and political arrangements, which means, at best, reducing the power of minorities, like the Hazaras and Tajiks, in addition to imposing Sunni Islamic law and principles as the bases of government. All this could be another potential source of tension between Iran and Afghanistan.

The Taliban as a Sunni-based emirate is inherently in conflict with Iran’s Shiite-based political system. While at the moment Iran should be assessing more important issues in regard to the Taliban and Afghanistan, this religious difference is a minefield that could revive the old enmity between Iran and Afghanistan shortly after they find themselves without a common enemy like the United States. It is hardly imaginable that Iran would tolerate a radical Sunni Islamist group at its border in the long-term and cope with it solely based on mutual interests.

Long story short, the agreement with the Taliban does not provide the United States with much more than what President George W. Bush demanded of the Taliban 18 years and $2 trillion ago. Contrary to formal proclamations, Iranian officials actually would prefer that US forces remain in Afghanistan. None of the forthcoming consequences of their leaving, especially a Taliban-backed government, will serve Iran's interests.