Two Iranian border guards and one Taliban fighter were killed after shooting broke out near a border post on Saturday.
It was not immediately clear what had provoked the incident, in which several people were also injured, but it came amid tensions over water rights.
Iran has accused Afghanistan's Taliban of violating a 1973 treaty by restricting the flow of water from the Helmand River to Iran's parched eastern regions, an accusation denied by the Taliban.
"Today, in Nimroz province, Iranian border forces fired toward Afghanistan, which was met with a counter-reaction," spokesman for the Taliban-run interior ministry, Abdul Nafi Takor, said in a statement.
"The situation is under control now. The Islamic Emirate does not want to fight with its neighbors," the spokesman said, without identifying the victims.
He said one person had been killed on each side and several injured, though Iran's official IRNA news agency later said two Iranian border guards had been killed and two Iranian civilians injured.
Following the clash, Iranian authorities closed the Milak – Zaranj border post, a major commercial crossing - and not the site of the clash - until further notice, IRNA said.
Iran's deputy police chief, Qasem Rezaei, said earlier: "Taliban forces started shooting at the Sasoli checkpoint ... drawing a decisive response.”
Iran's border guards said in a statement they had "used their superior heavy fire to inflict casualties and serious damage", without giving details.
A Taliban defense ministry spokesman said the Taliban "considers dialogue and negotiation to be a reasonable way for any problem. Making excuses for war and negative actions is not in the interest of any of the parties.”
Earlier in May, Iranian President Ebrahim Raisi warned the Taliban over disregarding Iran's water rights under the 1973 treaty. The Taliban rejected Raisi's perceived threat, with a former Taliban official mocking Raisi in a video that went viral.
Report by Reuters