Pakistan lodged a protest with Afghanistan over a brazen cross-border attack on Saturday by hundreds of Taliban fighters that killed 25 Pakistani troops, the foreign ministry said.
The Pakistani military blamed what it claimed was inaction by Afghanistan and NATO in the latest flaring of tensions between the neighbours.
"The Afghan charge d?affairs was called in today at the foreign ministry to lodge a protest on attacks from Kunar and Nuristan," foreign office spokeswoman Tehmina Janjua said in a statement.
"The Afghan charge d'affairs was conveyed the imperative of establishing peace and tranquility in the border region and effectively dealing with terrorists.
"The activities of the terrorists are a matter of great concern to both the governments and peoples of Pakistan and Afghanistan. They cannot be allowed to continue such blatant attacks from across the border."
Between 200 and 300 "terrorists" based in Afghanistan attacked seven paramilitary Frontier Corps checkposts in the northwestern Pakistani district of Chitral early Saturday morning, Pakistan's military said in a statement.
The term "terrorists" is frequently used by the military for Taliban and Al-Qaeda-linked militants. The military said both Pakistani and Afghan fighters were involved.
"At least 25 security forces personnel embraced shahadat (martyrdom) in the attack," the statement said.
About 20 of the militants were believed to have been killed. The border posts were overrun by militants, but reinforcements were later sent, it said.
The Pakistani military said that those believed to have co-ordinated the raid -- including a radical cleric from the Swat valley, Maulanah Fazlullah -- had previously fled into Afghanistan in the face of Pakistani military offensives.
"Since their expulsion from their native areas, the terrorists have organised themselves in Kunar and Nuristan provinces with the support of local Afghan authorities," the military's statement said.
It said the "scanty presence of NATO and ANA (Afghan National Army) forces" along the border had led to "safe havens" for militants on the Afghan side, allowing them to launch attacks in Pakistan.
Intelligence about the presence of Pakistani militants and their Afghan supporters had been passed to NATO and Afghan authorities, the statement said.
"But no worthwhile action has been taken against the terrorists and attack against Pakistani border posts have continued with impunity," it said.
It was the latest in a series of alleged cross-border incidents which have raised tensions between the neighbours as the Afghan war continues to claim a high toll after almost 10 years.
In July, more than 20 mortar shells from Afghanistan killed four Pakistani soldiers and wounded two others in South Waziristan. Pakistani officials blamed the Afghan army for that attack.
And in the same month, hundreds of Afghans took to the streets to protest over cross-border rocket attacks that they claimed had killed dozens of people in Kunar and Nangarhar provinces.
A diplomatic dispute over both military and insurgent cross-border attacks also escalated at that time, with Afghan President Hamid Karzai protesting to Pakistan's army chief and Pakistan's prime minister complaining back to Karzai.