No one in the Iranian government was sad to see U.S. and NATO troops leave Afghanistan. In fact, Tehran would prefer to have the Taliban next-door than often-hostile Western powers. But Shiite-majority Iran has also been a target of attacks in the past from the Sunni Islamist Taliban, and it worries that if Afghanistan descends into chaos, it could negatively affect Iran’s ability to exert influence and trade with its neighbor—or worse, that the volatility could spill over into Iran. Tehran will have to pull off a delicate balancing act if it’s to benefit from the U.S. and NATO withdrawal.
Iran has had a rocky relationship with the Taliban. The group killed Iranian diplomatic personnel and an Iranian journalist at Iran’s consulate in the northern Afghan city of Mazar-i-Sharif in 1998, during the years when it last controlled most of Afghanistan. These murders earned the Taliban a reputation for viciousness among the Iranian public, and the government came close to ordering a military response. Tehran actively supported the U.S. in ousting the Taliban and setting up a new government in Kabul in 2001. But Iran has also pragmatically worked with the Taliban when it had to, particularly from the 2010s onward, even forging links with parts of the group as a way to hedge its bets and maintain some influence with a powerful force in Afghanistan that was rapidly regaining strength.