Heavy gunfire and artillery shelling by Afghan border forces killed six civilians across the border in Pakistan on Sunday and wounded another 17, the Pakistan army said.
Pakistani troops retaliated at the Chaman border crossing in southwestern Balochistan province, the army said in a statement, without giving details of any losses on the other side.
Afghan official Noor Ahmad, in Kandahar, the province on the Afghan side of the border, told Reuters the incident was accidental and the situation had returned to normal after the two sides had a meeting.
He gave no further details on any casualties on Afghan side.
Afghan security sources said the clash started after Pakistani forces demanded that Afghan forces stop building a new check post on their side of the border.
The Pakistan army statement described the incident as an "uncalled for aggression" and said Pakistani troops had responded proportionately, avoiding the targeting of civilians on the other side.
"Afghan Border Forces opened unprovoked and indiscriminate fire of heavy weapons including artillery/mortar onto the civilian population," the statement said.
Pakistan had approached Kabul to demand action to avoid a recurrence of the incident, it said.
The busy Afghan border crossing at Chaman, used for trade and transit, was closed for some hours before reopening, officials on both sides said. The crossing was closed for several days last month after similar clashes.