Wherever there is chaos, violence, and suffering in the broader Middle East, Iran is likely present. Tehran has its malign tentacles entwined in virtually every conflict in the region—from Gaza, to Yemen, to Syria, and beyond. One such conflict is the war in Afghanistan, which the media rarely discuss in conjunction with Iran. Yet the Islamic Republic plays an important role in Afghanistan—one that is disruptive and that threatens American interests. As the Trump administration debates whether to withdraw from Afghanistan, not just the Taliban but also Iran stands to gain from an American retreat.

Iranian activities in Afghanistan gained renewed attention over the past two weeks, after Adm. Ali Shamkhani, secretary of Iran's Supreme National Security Council, confirmed for the first time late last month that Iran held talks with the Taliban, noting that the Afghan government was aware of the discussions. Days later, Iran also confirmed that the Taliban had visited Tehran for a second round of talks on ending the conflict in Afghanistan; the Taliban said they discussed Afghanistan's "post-occupation situation" with the Iranians. Then on Wednesday, Iranian Foreign Minister Mohammad Javad Zarif said during a visit to India that the Taliban must have a role, but not a "dominant" one, in Afghanistan's future. Iran's top diplomat also acknowledged that his country has "unofficial intelligence" contacts with the Taliban, adding that the Islamist group occupies areas by the border between Iran and Afghanistan.

Senior Afghan government officials took great offense to Zarif's comments. "If Iran believes in talks, it should pay attention to its domestic problems," Shah Hossein Mortazavi, deputy spokesperson of the Afghan president, wrote in a Facebook post that was later deleted. "These days they [Iran's Foreign Ministry] act in the role of Taliban spokesmen."

"Certainly, such statements create division between the Islamic Republic of Iran and Islamic Republic of Afghanistan and this would have a negative impact on our relations," added Sibghatullah Ahmadi, spokesman for the Afghan Ministry of Foreign Affairs.

Our Iranian friends; we may or may not bring in Taliban. But thank you for your advice. To reciprocate the neighborly goodwill, I call on you to share power with Mujaheddin Khalq and NCRI, release Karobi and Musavi and make peace with Saudi. Because we believe it is good for you.

The U.S. has sought to force the Taliban to negotiate a peace settlement with the Afghan government. But the Taliban, which refers to itself as the Islamic Emirate of Afghanistan, has consistently rejected talks with Kabul. The group seeks to topple the American-backed Afghan government and to re-impose strict Islamic law in Afghanistan as it existed under their totalitarian rule before the U.S. ousted them in 2001. That outcome does not seem so far-fetched now that the Taliban is engaged in diplomatic talks with an array of global powers, including the United States, and has the upper hand militarily.

Iran's recent comments on the Taliban are significant; in the past, Tehran has denied links to the group. It seems that, following reports indicating President Donald Trump wants to withdraw American forces from Afghanistan, Iran sees a golden opportunity to have a more public partnership with the Taliban and secure its interests inside the war-torn country.

Iran and the Taliban had a relationship before 9/1/ that included arms sales, even as both sides were bitter rivals. Since 9/11, however, Tehran has helped the Taliban in numerous ways, especially in recent years. As I previously wrote:

Since American troops entered Afghanistan in 2001, Iran has given consistent financial support to the Taliban, which has only increased in recent months as [the Islamic State] has moved into Afghanistan. Iranian military support, however, began before the invasion, and the lethal assistance continues today to be used against coalition forces. WikiLeaks documents from 2005-06 show that Iran also offered bounties for the murder of members of the Afghan government and NATO soldiers while [Iran’s Islamic] Revolutionary Guard Corps assisted Gulbuddin Hekmatyar, a leader of a prominent jihadist group in Afghanistan, to carryout terror attacks.

Iran is even using its own military academies to provide hundreds of Taliban fighters with advanced training, according to reports. Moreover, some high-ranking Taliban leaders even live in Iran.

Iran continues this support while maintaining ties with Kabul, hedging its bets to position itself well for various outcomes inside Afghanistan.

There are many reasons the Islamic Republic supports the Taliban, such as fighting the Islamic State, issues concerning water, and the fact that Afghanistan borders Iran and can pose a threat if unstable, among others. But the most important reason for Washington is that both Iran and the Taliban share an interest in forcing the Americans to leave Afghanistan. Iran is very concerned about American bases in Afghanistan and uses Afghanistan as a way to exert pressure on Washington as needed. If the U.S. wants the war in Afghanistan to end in a peaceful way, it must counter Iran's support to the Taliban—support that perpetuates the conflict.

Analysts and commentators have made several valid arguments about why an American withdrawal from Afghanistan, even a partial one, would carry serious costs. Indeed, one cannot argue that a return to a pre-9/11 Afghanistan, a very real possibility, serves the U.S. well in any way. Another reason less often discussed is that an American retreat—which is the right word to use—would be a victory for Iran.