Iran, which shares a 900 kilometre-border with Afghanistan, does not recognise the Taliban government.
Iranian forces and Afghanistan's Taliban have exchanged fire at Iran's eastern border.
"A clash erupted in the afternoon between Iranian border guards and the Taliban following a misunderstanding at the border near the Afghan province of Nimroz," Iran's Tasnim news agency reported on Wednesday.
Iranian foreign ministry spokesperson Saeed Khatibzadeh said a "border dispute between residents" of the area had triggered the incident, without referring to the Taliban.
"The situation has been resolved. Shooting stopped after contact between border guards of the two countries," he said in a statement.
Tasnim reported that "Iranian farmers passed beyond the protective walls erected within Iran, and the Taliban reacted by deeming that their border had been breached".
The Taliban opened fire and Iranian forces responded, it said.
The Taliban's deputy spokesperson Bilal Karimi was quoted by Afghan television station Tolo News confirming the incident took place but declining to provide details.
"He said the clashes had stopped and did not provide information about their cause," the station said in a tweet.
Iran seeks "friendly" approach
Iran, which shares a 900 kilometre-border with Afghanistan, does not recognise the Taliban government formed after the insurgents seized the capital Kabul in August.
In late October, Tehran called on the Taliban to adopt a "friendly" approach towards their neighbours, in a meeting of six of countries that share borders with Afghanistan.
Although the Iranian government has had generally good relations with the Taliban, there have been longstanding tensions along the border, which has active smuggling routes and thousands of refugees crossing every day.