At least five soldiers killed in Kurram district of northern Khyber Pakhtunkhwa province, Pakistani military says, in an attack claimed by TTP terror group.
At least five Pakistan soldiers have been killed by firing from neighbouring Afghanistan, Islamabad said, in an attack claimed by the banned Pakistani Taliban.
Sunday's attack comes just days after members of BLA (Balochistan Liberation Army) terror group in the southwest killed nine Pakistan troops in a series of brazen attacks that officials said involved planners from Afghanistan as well as India.
After seizing power in August, Afghanistan's Taliban pledged terror groups would not be allowed to operate from the country, but anti-Pakistan militant groups have long taken sanctuary across the porous border.
They include the Tehreek-e-Taliban Pakistan (TTP), which on on Sunday claimed responsibility for the attack in the Kurram district of rugged Khyber Pakhtunkhwa province.
The TTP said it killed six Pakistani troops in Saturday night's attack, but the Pakistan military's public relations wing (ISPR) said five Frontier Corps members had died.
"Own troops responded in a befitting manner," it said, adding "terrorists suffered heavy causalities".
Pakistan "strongly condemns the use of Afghan soil by terrorists", ISPR said.
The army "is determined to defend Pakistan's borders against the menace of terrorism, and such sacrifices of our brave men further strengthen our resolve".
The Taliban are separate groups in both countries, but share a common ideology and draw from people who live on either side of the border.
Links to India, Afghanistan
The TTP has been emboldened by the return to power of the Taliban in Afghanistan and has stepped up attacks since a month-long truce with the Pakistan government ended last year.
It took four days until Saturday for Pakistani troops to put an end to assaults by terrorists in Balochistan province, with the army putting the final death toll at 20 militants and nine soldiers.
The ISPR said intelligence agents intercepted communications during those assaults on army posts that showed BLA terrorists had links to Afghanistan and India.
Baloch militants have waged an insurgency in the vast southwestern province for years, fuelled by anger that its abundant reserves of natural resources are not relieving citizens from crushing poverty.
The fighting came as Pakistani Prime Minister Imran Khan was making an official visit to China, which has invested significantly in Balochistan.
Chinese investments in Balochistan are part of Beijing's Belt and Road Initiative.
A Pakistani security official told AFP news agency on Friday that the attacks were an attempt to derail Khan's visit to China.
The China-Pakistan Economic Corridor (CPEC) project linking China's far-western Xinjiang Uighur Autonomous Region with the strategic port of Gwadar in Balochistan has sparked claims that the vast influx of investment does not benefit locals.
While the economic corridor offers a lucrative gateway for China to the Indian Ocean, the security of its workers has long been a concern.
Afghan Taliban renews promise
Pakistan's government announced late last year it had entered a month-long truce with the TTP, facilitated by Afghanistan's Taliban, but that expired on December 9 after peace talks failed to make progress.
Earlier this week the Afghan Taliban again insisted foreign militant groups would not be allowed to operate inside the country.
"This is our responsibility and we have made a promise," Foreign Minister Amir Khan Muttaqi told AFP in an interview.
"We stand on this word, and we are working on it day and night –– to strengthen our borders and our security."