Iran, which shares a 900 kilometre border with Afghanistan, does not recognise the Taliban government formed after the group seized the capital Kabul in August.

An exchange of fire erupted Wednesday between Iranian forces and Afghanistan's Taliban at Iran's eastern border, local media reported.

"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 said.

Iran, which shares a 900 kilometre border with Afghanistan, does not recognise the Taliban government formed after the group seized the capital Kabul in August.

Iranian foreign ministry spokesman 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.

In late October, Tehran had called on the Taliban to adopt a "friendly" approach towards their neighbours, in a meeting of six of countries that share borders with Afghanistan.

Iran has appeared to edge towards a pragmatic rapprochement with the hard-line Sunni Islamist group in recent months.