Security personnel of the neighbouring countries started exchanging fire in a dispute over the setting up of a military check post in a border area that divides Chaman and Spin Boldak districts.
Clashes between Afghan and Pakistani security forces have killed two people and wounded several in a border region.
The forces started exchanging fire over the setting up of a military check post in a southwestern border area that divides Chaman and Spin Boldak districts, three security officials told Reuters.
Both sides blamed each other for starting the clashes that later spread to several nearby villages.
"It is regrettable that the Pakistani security officials first opened the fire," Afghan Taliban government spokesman Zabihullah Mujahid said in a tweet.
Two civilians were killed and 22 wounded on the Afghan side, local Taliban spokesman Mohammad Asif Hakimi said. Five Taliban fighters were also wounded, he said.
"Afghans made the first move and opened unprovoked fire on Pakistani troops when they asked Afghan soldiers to stop work on a post located on the Pakistani side," a Pakistani security official said.
Pakistani officials said several were wounded including four security officials. It is difficult to independently verify claims in the border region, which is off limits to journalists.
Tensions at the border
Pakistan's army, which didn't respond to a request for comment, has stepped up security operations along the Afghan border in recent weeks after a spate of militant attacks.
Separatist factions have killed at least 14 Pakistani soldiers in attacks over the past month, three of them carried out by fighters entering from Afghanistan.
The Taliban have denied Afghan territory was used to stage the attacks.
Despite such assurances, disputes linked to the border have been a bone of contention between the neighbours for decades.
The Taliban have attempted to block Pakistan's plans to finish fencing the 2,600-kilometre (1,615 mile) border drawn by British colonial rulers with no consideration for the Pashtun tribes it divided.
It has never been recognised by any Afghan government.