Iran says it is investigating Afghan troops who shot at Iranian forces after crossing over the border.
Iran's ISNA news agency says Iranian border guards encountered the Afghan troops traveling by car, armed with rifles and a grenade launcher.
Border police commander Hossein Zolfaghari said the six officers and one soldier were detained, and told officials they were looking for Taliban militants and crossed into Iran by accident.
Zolfaghari did not say when the arrests took place.
Both Afghanistan and Iran have been battling insurgents and smugglers along their joint border.
Earlier this month, Afghan officials said they seized at least 19 tons of explosives found in shipping containers imported from Iran.
Afghanistan has previously accused Iran of selling weapons to the Taliban, allegations Tehran denies.
Some information for this report was provided by AP, AFP and Reuters.