As of this December, 40 years will have passed since the Soviet Union invaded Afghanistan—a period that coincides with virtually the entire lifespan of the Islamic Republic of Iran. Throughout those four decades, Tehran has struggled to protect and project its interests within the borders of its tumultuous eastern neighbor. Iran’s activities in Afghanistan have not drawn the outside attention that its operations in Iraq, Syria, Yemen, and the Persian Gulf attract. But Afghanistan remains an important and often difficult arena of Iranian foreign policy, a country where Tehran’s decision-makers are slowly righting the course after decades of falling short.

Iran’s interests in Afghanistan are in some respects parochial. Iran has traditionally focused its efforts on the empowerment of Persian speakers in the country and the protection of Afghan Shiites—one-fifth of Afghans are Shiite—who in recent years have been subject to horrific attacks by Sunni militants, including the so-called Islamic State (ISIS).

But above all, Iran wants to see stability in Afghanistan. The Soviet occupation and subsequent instability sent an estimated three million Afghan refugees into Iran, where their presence strained resources and public services in many towns and cities across the country. Moreover, Tehran fears that Saudi Arabia will exploit volatility in Afghanistan to cultivate proxies on Iran’s eastern flank.

Though Washington and Tehran are at odds in many other places, their interests are not mutually exclusive in Afghanistan. Iran does not want to make its eastern neighbor an arena of conflict between itself and the United States. It will not target U.S. bases and troops in Afghanistan even in the event of escalating hostilities in the Persian Gulf, as that would guarantee turmoil and volatility on Iran’s eastern border for years to come. Iranian policymakers do want U.S. forces to leave Afghanistan, because they are convinced that the situation in the country can now be managed diplomatically.

The more that Iran has placed stability at the center of its Afghanistan strategy, the more it has improved relations with an erstwhile foe: the Taliban. Much like the United States, Iran has come to accept that accommodating the Taliban is the only way to build a more peaceful future for its neighbor.

BROTHERS IN ARMS

Deep cultural and linguistic ties link Iran and Afghanistan. Iran’s national language, Farsi (or Persian), is widely spoken in Afghanistan in the local Dari variant and in other dialects. Iranians and Afghans consume much of the same literature, television, and music. Herat, the biggest city in western Afghanistan, was part of Iran into the nineteenth century and holds a historic place in Persian culture. In modern times, religious identity has formed another important cross-border connection. Both the prerevolutionary Iranian monarchy and the Islamic Republic have invested heavily in the Afghan Shiite community by funding mosques, universities, and charitable institutions primarily among the Hazara ethnic group, who make up the bulk of Shiites in Afghanistan.

All of these ties have long shaded Iranian policy in Afghanistan. During the Soviet occupation in 1980s, Iran was at war with Iraq and too distracted to really focus on shaping the anti-Soviet Afghan resistance. Instead, it supported a smattering of Shiite and Hazara militias. After the Soviet withdrawal, those militias coalesced into a pan-Shiite group called Hezb-e-Wahdat-e Islami Afghanistan (Islamic Unity Party of Afghanistan), but it was relatively minor compared to Sunni mujahideen groups backed by Pakistan, Saudi Arabia, and the United States.

In 1996, Iran almost invaded Afghanistan to prevent the west of the country from falling to the Taliban.

By framing its involvement in Afghanistan through the prism of Shiite and linguistic affiliations, Iran had limited the influence it could have on the direction of the country after the Soviets left. The Sunni, mostly Pashtun, and Pakistan-backed Taliban swept to power in 1996, leaving Iran’s Supreme National Security Council to fret about the fate of Shiite and Persian-speaking populations. The council voted to invade and seize Herat—but the invasion never happened. In 1998, a Pakistan-linked group allied to the Taliban killed 11 Iranian diplomats and a journalist at the Iranian consulate in the northern Afghan city of Mazar-e Sharif, and Iran mobilized 200,000 troops on the border. Along with India, Russia, and other regional powers, Iran supported the Northern Alliance, the coalition of militia groups that resisted Taliban control in the north of Afghanistan.

Given this history, Iran chose to abet the U.S.-led military coalition that used the manpower of the Northern Alliance to overthrow the Taliban in November 2001. Though the expanded U.S. presence in Afghanistan did not thrill Iranian leaders, the growing Pakistani and Saudi influence in the country perturbed them even more.

Iranian officials have bristled at Pakistan's repeated attempts both before and after the Soviet invasion in 1979 to install Pashtun-dominated governments in Kabul. Pakistan depends on aid from Saudi Arabia and channels Saudi interests in the region by sponsoring hard-line Salafi groups, offering clandestine support to violent insurgents operating in the Iranian province of Sistan and Baluchistan and, perhaps most important, by inflaming anti-Iranian factions within the Taliban. As augured by the 1998 attacks in Mazar-e Sharif, Sunni militants have struck Iranian targets in Afghanistan before and could do so again.

An Iranian soldier in the border province of Sistan and Baluchistan, December 2003 Giovanni Porzio / Contrasto / Redu​x

MENDING FENCES

Iranian leaders expected that the Taliban’s overthrow in 2001 would diminish Pakistan’s sway over Afghan politics. Instead, to Tehran’s frustration, Pakistan’s influence continued more or less unabated even after the 9/11 attacks upended the region.

Islamabad’s objectives in Afghanistan have not changed. Pakistan views a friendly Afghan government as essential to its “strategic depth” with regard to its rival, India. This enduring imperative has led Pakistan to cleave to the Taliban even after the group was toppled and even in the face of international opprobrium.

Ties between Pakistan and the United States have suffered some strain on account of this commitment. And yet Iran has little faith that a U.S. military presence in Afghanistan can check Islamabad’s influence. With that in mind, Iran supports the withdrawal of U.S. forces even if it comes at the expense of a re-empowered Taliban. Iran will continue to foster firm relations with the government of Ashraf Ghani—recently, Iranian and Afghan officials agreed to closer energy cooperation—but whatever the ambitions of Kabul, Tehran has realized that the Taliban and its backers in Pakistan will remain major actors in Afghanistan. If Iran wants to remain relevant in the country and minimize Pakistani influence, it must also court the Taliban.

Iran’s relationship with the Taliban has already come a long way since the acrimony of the 1990s. Though the United States periodically accuses Iran of collaborating with the Taliban at an operational level, little credible evidence suggests such collaboration. Plenty of evidence, however, suggests that political ties between Iran and the Taliban are improving. Last December, Ali Shamkhani, the secretary of Iran’s Supreme National Security Council, confirmed that Iran had begun holding talks with the Taliban—in coordination with the government in Kabul—in order to address “rampant insecurity” in Afghanistan.

If Iran wants to remain relevant in Afghanistan, it must court the Taliban.

Some Taliban factions do harbor animosities against Shiite Afghans and against Iran. But other factions of the Taliban are willing to establish better relations with Tehran. Iranian diplomats are giving the leadership of the Taliban more reason to trust them. Iran is publicly signaling its recognition of the importance of the Taliban: Iran’s foreign minister, Javad Zarif, prompted the outrage of the Ghani government when he insisted on Indian TV in January 2019 that the Taliban must play a role in any future political configuration in Afghanistan.

Twenty years ago, even ten years ago, such rhetoric would have been unthinkable from an Iranian foreign minister. But Iran has recalibrated its priorities in Afghanistan and will try to reach an accommodation with the Taliban regardless of what the United States achieves or fails to achieve. Only a week after talks with the United States collapsed in September, a Taliban delegation arrived in Tehran. Iran knows that it must keep its former foes close to keep bigger enemies at bay.