Afghan refugees gather at the Iran border after the Taliban victory. Photo: AFP / Mohammad Javadzadeh / Iranian Red Crescent

On the surface, a crisis should be emerging on Iran’s eastern border as the Taliban seizes power and establishes a new Sunni-led Islamic emirate.

Yet despite a history of hostility rooted in Sunni-Shiite antagonism, Tehran doesn’t appear troubled by the militant group’s return to power.

Iran shares a rugged 921-kilometer border with Afghanistan, one that has seen dire spillover effects over the course of its long war. More than three million Afghan refugees and undocumented migrants now live in Iran, a point of tension over the years.

But Iran is now seeking to turn a cross-border crisis into an opportunity as an incubator of post-war reconstruction, with multiple trade, security, energy and transportation agreements potentially in the works to bolster the budding Tehran-Taliban partnership.

Two-way trade currently amounts to US$2 billion annually, making Iran the largest commercial partner of Afghanistan. In 2019, Iran was Afghanistan’s top import trading partner, according to World Bank data, and more than 40% of Afghanistan’s oil comes across the Iranian border.

The ties run deeper still. Many influential Afghan  figures have been educated in Iran. As many as 40,000 Afghan students are enrolled in higher education programs at Iranian universities.

Nearly a million Afghans throng the shrine cities of Mashhad and Qom annually for pilgrimages to two major Shiite sites in Iran.

But relations are just as conflicted. Iran and the Taliban found themselves on the cusp of all-out war in 1998 after the fundamentalist rebels unleashed a lightning strike to capture the city of Mazar-i-Sharif in northern Afghanistan, where they besieged the Iranian consulate and killed nine diplomats and a top journalist.

Taliban fighters patrol the streets of Kabul on August 23. Photo: AAAFP / Wakil Kohsar

In response to the raid, which sparked a flurry of public anger across Iran, the Iranian government put its armed forces on alert and deployed 70,000 troops on its Afghan border vowing stern retaliation.

War was only averted after the Taliban, under the pressure of the United Nations, repatriated the bodies of the murdered diplomats and released 50 Iranians it had taken captive.

Among the Taliban, it is well known that Iran closely coordinated with the United States after the 9/11 attacks to oust the Taliban from power and form a US-backed civilian, national government.

Working in tandem with the US to topple the Taliban was one of the rare occasions Tehran and Washington helped each other since breaking off diplomatic ties in 1979, finding rare geopolitical common cause to overthrow the jihadist militants.

Iran’s diplomatic assistance to the US during the nine-day United Nations-sponsored talks in Bonn, Germany, in December 2001, culminating in the signing of an agreement on a provisional government in Kabul, was open for the world to see.

Iran’s outgoing top diplomat Javad Zarif was deputy foreign minister for international organizations at that time who engaged the US presidential envoy James Dobbins and the head of the Northern Alliance delegation Yunus Qanooni to overcome an impasse on the configuration of the interim Afghan government.

Those diplomatic efforts, however, were upended when then-president George W Bush, in his 2002 State of the Union address, designated Iran as a member of an “axis of evil,” complemented by North Korea and Iraq. Iranian officials, who perceived the categorization as a declaration of war, still recall Bush’s remarks resentfully.

When the Bush administration invaded Iraq in 2003, Iranians feared a similar regime change putsch could be launched to bring down the government in Tehran. The brewing threat hardened anti-US attitudes and compelled a rethink about how to deal with the Taliban.

Iran supplied aid to the Afghan government and the Taliban during the presidency of Hamid Karzai. Photo: AFP / Yuri Kadobnov

When Hamid Karzai became Afghanistan’s first democratically elected president, Iran supplied financial aid to the Afghan government while at the same time funneled ammunition, weapons and bags of cash to Taliban fighters and offered bounties for the killing of US soldiers.

One of the fault lines between Shiite-majority Iran and the Sunni Taliban has been the radical clique’s obstinate pattern of mistreating and persecuting Hazara Shiites, who comprise roughly 10% of the population of Afghanistan. In 1998, when the Taliban was seeking to takeover Mazar-i-Sharif, at least 2,000 Hazaras were massacred by the militant group on ethnic lines, according to Human Rights Watch.

The Taliban’s aversion to the Hazaras hasn’t subsided over the years. According to Amnesty International, at least nine ethnic Hazara men were killed by Taliban fighters upon taking control of Ghazni province in July.

But it appears that the Islamic Republic is now disposed to gloss over its ideological mission of championing the Hazaras, apparently in favor of a broader policy: anti-Americanism.

Iran and Taliban both view the US as a sworn enemy. To Tehran, the chaotic US withdrawal from Afghanistan is a dream come true, which can smooth the path for the consolidation of an anti-US front in the region.

In that direction, Iran and the Taliban are adopting an “enemy of my enemy is my friend” line that may or may not hold after the US has fully withdrawn, experts and observers say.

Joshua Shifrinson, an associate professor of international relations at Boston University, told Asia Times the anti-American thrust proselytized by Iran and Taliban is not merely an ideology but a reflection of their concerns and exigencies.

“I don’t think that anti-Americanism is an ideology. An ideology describes an ideal world. The Taliban dislike the United States but that’s not an ideology. It’s simply a strategic priority for them right now,” he said.

An Afghan refugee who escaped from his home city of Herat with his family in their home south of Tehran. Photo: AFP / Morteza Nikoubazl / NurPhoto

“The same applies to Iran, which has operated for 40 years facing real tensions with and threats from the United States. Of course, the US feels the same way about Iran. Right now, therefore, Iran and the Taliban have a common reason to oppose the United States.”

But as the US withdraws from Afghanistan and improves relations with either Afghanistan or Iran, it was likely that Iranian-Taliban ties will fray as competing Iranian and Taliban interests reassert themselves.

“Likewise, the more the US pressures Iran over its nuclear program, the more Iran is likely to cooperate with actors – state and non-state – opposed to the US regardless of their ideology and human rights record,” he said.

“If bilateral relations between the US and Iran improve, however, then Iran is less likely to ignore others’ thuggish domestic behavior and attitudes.”

The Iranian government has recently made clear its intentions to normalize relations with the Taliban.

On August 21, Ofogh TV, one of the most conservative state TV stations in Iran, aired a lengthy live interview with Mohammad Naeem, the spokesman for the Taliban’s political office, in which he said the Taliban is seeking respectful and friendly relations with Iran.

A recent documentary broadcast on state TV claimed the attack on the Iranian consulate in Mazar-i-Sharif in 1998 was perpetrated by gunmen dressing up as and pretending to be Taliban members, rather than genuine combatants of the group.

The Tehran government’s bid to contort history and whitewash the Taliban’s track record of violence against minorities, women and Iranian diplomats could be setting the stage for the recognition of a Taliban-led government in Kabul.

Taliban spokesman Mohammad Naeem says the Taliban is seeking respectful and friendly relations with Iran. Photo: AFP / Sefa Karacan / Anadolu Agency

“The question of recognition is complicated. My sense is Iran would take cues from major powers like China and Russia. Given that it has concerns about the security of the Hazara population in Afghanistan, it will also wait for more clarity on Taliban’s position on religious minorities,” said Asfandyar Mir, a South Asia security scholar with Stanford University’s Center for International Security and Cooperation.

“In the meantime, as always, the Iranian government will continue to hedge, lean towards the Taliban but maintain other options,” he told Asia Times.

Some pundits believe Iran, already isolated by much of the West, will not be singled out for making overtures to a movement that is still widely labeled as a terror organization.

“The Taliban is not anymore internationally isolated as it was in the 1990s. The support of China and also Russia has ensured their protection from international isolation,” said Ashok Swain, a professor of peace and conflict research and UNESCO chair of international water cooperation at Uppsala University.

“Besides the support from Pakistan, the Taliban is also receiving support from the Gulf countries and even Turkey. So, the support of Iran to the Taliban in Afghanistan is not going to get international censure as Pakistan used to get in the 1990s,” he added.

Iranian authorities have in recent years touted the idea of a “comprehensive Islamic government” in Afghanistan, similar to the theocracy installed in Iran 42 years ago.

“Although Taliban and the regime in Iran are from two different and bitterly opposed sect orientations, their theological outlook of an Islamic state does match and in theory the Iranian government is right that Taliban can create a comprehensive Islamic government in the country,” said Umer Karim, a visiting fellow at the Royal United Services Institute.