"I think it would be impossible to have a future Afghanistan without any role for the Taliban," Mohammad Javad Zarif, who is in New Delhi for talks with Indian officials, told NDTV in an interview.
"But we also believe that the Taliban should not have a dominant role in Afghanistan."
He said Iran has had intelligence contacts with the Taliban because it needed to secure border areas controlled by the Taliban on the Afghan side.
The Taliban have been fighting to oust all foreign forces and defeat the government after their 2001 ouster by US-led troops.
Zarif said it was up to Afghans to decide what role the Taliban should have but Afghanistan's neighbors would not want them to be in overall control.
"Nobody in the region believes that a Taliban dominated Afghanistan is in the security interests of the region. I believe that is almost a consensus."
Efforts for a negotiated settlement of the 18-year war in Afghanistan have gathered pace in recent weeks, even as reports that US President Donald Trump plans to withdraw thousands of US troops have triggered uncertainty in Kabul.
US Special Representative for Afghanistan Reconciliation Zalmay Khalilzad has held three rounds of talks with the Taliban, but on Tuesday, the militants canceled a fourth round, which had been due in Qatar this week.
The militants said they called off the talks because of an "agenda disagreement", especially over the involvement of officials from the Western-backed Afghan government as well as a possible cease-fire.
A Taliban source speaking about the canceled talks told Reuters that US officials had insisted that the Taliban should meet Afghan officials in Qatar and said "both sides were in disagreement over declaring a cease-fire in 2019".
The Taliban have rejected repeated requests from regional powers to allow Afghan officials to take part in the talks, insisting that the United States is their main adversary.
Zarif also hailed Pakistan for trying to play a "positive role".
"We believe that Pakistani position on Afghanistan is evolving and we believe that Pakistan now is trying to play a positive role in getting a peace process underway in Afghanistan. I understand that the Pakistanis also do not wish to see an Afghanistan dominated by extremists groups... but for Pakistan it is an existential threat. Extremism in Pakistan and Afghanistan is an existential threat for Pakistan," Zarif said.
"We disagreed with Pakistan in the 90s when they created the Taliban or helped create the Taliban. We were the first to offer victims to suffer in the hands of the Taliban – 11 of my colleagues were murdered by the Taliban, but we cannot be prisoners of the past. We need to work for a better future and Iran is ready to work with Pakistan in order to realize what the Pakistani leaders have been telling us that they believe fighting extremist groups is in their national security interest and we believe analytically, that that is the case."
Reuters contributed to this story.