Taliban's gains put neighbouring Iran on edge but the majority Shia country "is in constant communication with all political sides in Afghanistan", including the insurgents, in a marked change from when the group was last in power.
Iran's foreign ministry has called on "all parties" in Afghanistan to refrain from using violence, saying Tehran supports the establishment of an "inclusive" government in Kabul.
The Taliban took Afghanistan's capital on August 15, exploiting a vacuum caused by the withdrawal of US troops from the country and a collapse by the Afghan army.
"All groups and political parties [in Afghanistan] must refrain from using force and proceed using negotiation and talks," ministry spokesperson Saeed Khatibzadeh told reporters at a televised press conference in Tehran.
Iran "is in constant communication with all political sides in Afghanistan" and "supports the peaceful transition of power to an inclusive government," he added, stressing that "the crisis has no military solution".
Khatibzadeh said Iran hoped that such a government would be able to build a "safe, blooming and stable Afghanistan" using the "opportunity" of foreign forces' withdrawal.
Analysts say the Taliban's advances have put neighbouring Iran on edge, but the majority Shia Islamic republic is taking a pragmatic stance on the hardline Sunni group's resurgence.
Over the last few days, Iran restarted the exports of gasoline and gasoil to Afghanistan, Iran's Oil, Gas and Petrochemical Products Exporters' Union said on Monday. The move was made after receiving a request from the Taliban.
Tensions existed between Iran and the Taliban when the latter was in power in Afghanistan between 1996 and 2001. Tehran never recognised their rule.
The Taliban was toppled in a US-led invasion over their links to Al Qaeda, which carried out the 9/11 attacks.
Iran has stressed in recent months that the Taliban must be "part of a future solution" in Afghanistan.
Khatibzadeh said that Pakistan's Foreign Minister Shah Mahmood Qureshi will visit Tehran on Thursday to discuss bilateral ties and "especially the issue of Afghanistan".