Exchanges of fire and protests threaten to worsen strained relations between Kabul and Islamabad, despite renewed efforts last month by US Secretary of State John Kerry to get them to work more closely on peace efforts.
The Afghan foreign ministry said it summoned the Pakistani charge d'affairs to protest the "unprovoked attack by Pakistani forces".
Pakistan would bear the responsibility for "any consequences" in case of further attacks on Afghanistan, it said in a statement.
Cross-border clashes flared earlier today between Afghan and Pakistani security forces for a second time in five days as Kabul and Islamabad engaged in a war of words over the porous frontier, officials said.
Afghanistan and Pakistan are in dispute over a site where Pakistan has tried to construct a gate on what Afghans say is their territory. Clashes last Wednesday in the same spot killed an Afghan guard and wounded two Pakistanis.
"Today the Pakistanis returned to the construction site and said they will rebuild the installations," said Afghan interior ministry spokesman, Sediq Sediqqi.
"Our border police told them not to do so. The Pakistanis fired at them and our police returned fire. The fighting lasted for two hours before the Pakistanis requested a ceasefire," the spokesman added.
He told AFP the clashes had since stopped and the Pakistani border guards had left the site of the construction.
"They fired mortars and automatic weapons," one Pakistan official told AFP on condition of anonymity.
"Our troops responded with retaliatory fire. There have not been reports of any casualties so far. The exchange of fire continues at intervals," a second official said, also on condition of anonymity.
Kabul accuses Islamabad of playing a double game in supporting Taliban insurgent attacks on US and Afghan troops. Pakistan denies the allegations and is locked in its own battle against the Pakistani Taliban.
On Saturday, Afghan President Hamid Karzai said the cross-border clashes could be an attempt by Islamabad to put pressure on Kabul to accept the "Durand Line", the disputed border which Afghans do not accept.
