Iran once considered Afghanistan's hard-line Taliban as one of the greatest threats to its security.
As the Taliban ruled most of Afghanistan in the 1990s, the hard-line Sunni regime persecuted the country's Shi'ite minority and created its own theocratic political system to rival the Shi'ite clerical regime in Tehran.
However, scores of Afghan officials, lawmakers, and insurgent leaders now see the two former adversaries united in a covert alliance ostensibly aimed at stemming the expanding reach of Islamic State (IS) militants.
The ultra-radical, anti-Shi'ite Sunni organization now controls large swathes of Syria and Iraq and is engaged in a large war against Tehran's allies in the two countries. In Afghanistan, IS has emerged as the one of the main threats to the Afghan Taliban's status as the main insurgent group since last year.
This month, the Taliban and IS have engaged in bloody battles in the southern Afghan province of Zabul. Atta Jan Haqbayan, the head of Zabul's provincial council, says the dominant Afghan Taliban faction led by Mullah Akhtar Mohammad Mansur is visibly benefiting from Iranian support in its fight against IS in Zabul.
"Fighters loyal to Mansur are using Iranian mines and other weapons," he said. "We have also found other evidence of Iranian involvement and support for the Taliban."
In the capital, Kabul, Muhammad Nazeer Ahmadzai, the deputy speaker of Olasi Jirga, the lower house of Afghan Parliament, says many lawmakers have raised this issue in the legislature in recent weeks.
"They claimed that Iran is supporting the Taliban by providing weapons and supplies," he said. "If Iran has any fears or concerns, they should first share it with our government. We consider any support for Afghan insurgents illegal and an unwanted interference in Afghan affairs."
Senior Afghanistan officials have similar complaints. "Our western, southern, and eastern border provinces face serious security threats," said Abdul Ghafoor Liwal, a deputy minister for border and tribal affairs. "No Afghan in those regions can run insurgent operations or drug-trafficking rackets without substantial foreign support."
Samilullah Samim represents the western Afghan province of Farah in the Olasi Jirga. He says Tehran is supporting the Taliban in the province, which shares a long border with Iran.
"There were many battles between the Taliban and Daesh (Arabic name of IS) this summer. Everybody was convinced that Iran is supporting the Taliban to crush IS," he said.
Farah's police chief, Fazal Mohammad Samadyar, agrees. He told Radio Free Afghanistan that without Iranian support Taliban units in the region would not be able to operate. "The Iranians have been supporting the Taliban for years. I cannot rule out the possibility that they are now cooperating against Daesh," he said.
Abdul Manan Niazi, the deputy leader of a Taliban breakaway faction, says Tehran has supported Mansur for the past three years. "I think he [Mansur] is misleading Tehran by claiming he is going after Daesh in Afghanistan. There is no Daesh presence in Afghanistan yet," he told Radio Free Afghanistan.
Kabul has been very vocal in denouncing Pakistani support for the Taliban, but it has not officially raised the issue with Tehran. Officials in Tehran have not commented on these claims. Afghanistan-based Iranian diplomats rarely speak to the media.
This year saw high-profile Taliban defections as fighters loyal to the two organizations clashed in several provinces. While the Taliban have not commented on support from Iran, their hatred for IS is intense.
In an open letter to IS leader Abu Bakr al-Baghdadi in June, Mansur warned against "the creation of a parallel jihadist front or leadership [in Afghanistan]." The Taliban leaders said such efforts "will pave the way for disagreements, schisms, and conspiracies."
In a thinly veiled threat, Mansur said, "[We] will be forced to react to defend our achievements."
A high-ranking Taliban delegation visited Iran in May, and senior Taliban officials termed it fruitful. "Iran assured us of their full support and cooperation in resolving the issues in the region," a Qatar-based Taliban leader told NBC News.