Pakistani officials accused up to 60 Afghan soldiers on Monday of crossing into Pakistani territory and sparking clashes that killed two tribesman.
It was the latest in a series of escalating cross-border attacks reported in Afghanistan and Pakistan that are inflaming tensions along the porous border as NATO prepares to end its combat mission against the Taliban in 2014.
Both countries blame each other for harbouring Taliban fighters active on both sides of their 2,400 kilometre (1,500 mile) border, fanning distrust between Kabul and Islamabad, and complicating a peace process in Afghanistan.
Kabul threatened to report Islamabad to the UN Security Council over what it alleges is the shelling of villages, while Islamabad said it would protest formally to Kabul against the latest incursion.
"If our bilateral discussions regarding this issue brings no result, we will refer this issue to the United Nations Security Council," Afghan foreign ministry spokesman Faramarz Tamana told AFP.
In Pakistan's semi-autonomous tribal belt, security officials said two tribesmen were killed in Upper Kurram district in clashes with 60 Afghan army soldiers.
Another tribesman was also wounded "after they traded fire with Afghan army soldiers on seeing them inside Pakistani territory," a senior official told AFP on condition of anonymity.
The clashes lasted for more than 90 minutes after which security forces were sent to the area on the Afghan border, he said.
Local residents said the Afghans were pursuing attackers fleeing Shehar-e-Nau village in Paktia province.
Afghan defence officials denied the alleged incursion.
"We are not aware of such an operation by ANA (Afghan National Army) in that area," Daulat Wazir spokesman for the Ministry of Defence said.
Colonel Ahmad Jan, spokesman for army corps 203 in southeastern Afghanistan said: "It is not true, our forces have not entered Pakistan. We have not had any operations near the border recently."
A spokesman for Afghanistan's National Directorate of Security intelligence agency said cross-border fire had killed four people, including a woman and a child, and wounded six others, in the last week.
Afghans and Americans blame Pakistan for not doing more to eliminate havens on its soil, which are used as launch pads for attacks across the border.
Last month, the US commander of NATO in Afghanistan blamed the Pakistan-based Haqqani network for a siege on a lakeside hotel in Kabul that killed 18 people.
US Defense Secretary Leon Panetta also warned last month that Washington was running out of patience with Pakistan over militant havens.
But in Pakistan, border attacks have raised fresh concerns that Pakistani Taliban, who fled a 2009 army offensive, have regrouped and again pose a threat.
Officials said dozens of militants based in Afghanistan on Sunday attacked a checkpost in Upper Dir, a district in the government-controlled part of Pakistan, for the second time in eight days.
They said six militants were killed after crossing into Sabir Killey village in the Soni Darr area of Upper Dir. One official told AFP the "firefight continued late into the night".
Another official said there were reports "hundreds of militants" were gathering in Afghanistan's eastern province of Kunar.
"Authorities have alerted local lashkars (tribal militia) amid fears of a bigger clash," he told AFP on condition of anonymity.
Intelligence officials say the attackers are loyalists of Maulana Fazlullah, who fled into Afghanistan when the army recaptured the Swat valley after a two-year Taliban insurgency ended in 2009.
Swat neighbours Upper Dir, which is a key transit route between Afghanistan and Pakistan.
The valley was once a popular tourism destination and unlike the semi-autonomous tribal belt on the Afghan border, lies just 100 kilometres (60 miles) from the capital Islamabad.
The Taliban released a video showing severed heads of 17 Pakistani soldiers who they said were killed in a similar cross-border attack on a check post in Soni Darr on June 24.
A senior official confirmed that all 17 in the video were security personnel.
Islamabad lodged a strong protest with Kabul over the June 24 attack.