The Taliban launched the attack late last night and killed at least eight soldiers, Pakistani military officials were quoted as saying by CNN.
Fifteen Taliban fighters were killed in the exchange of fire that followed the attacks in Upper Dir district of Khyber-Pakhtunkhwa province.
Pakistani Taliban spokesman Ehsanullah Ehsan said the Afghan Taliban carried out the attacks.
The Pakistani Taliban helped with reconnaissance and information before the attack, Ehsan told CNN.
At least five Pakistani soldiers were reported missing after the clashes, The Express Tribune reported on its website.
Authorities had lost communications with a patrolling party that was attacked, an unnamed official told the newspaper.
There was no official word in this regard.
More From This Section
The attacks were the latest in a series of cross-border assaults from regions in eastern Afghanistan where US troops began pulling out last year.
Similar cross-border attacks by the Taliban killed dozens of Pakistani soldiers last year and increased tensions between Islamabad and Kabul.
On Friday, at least one soldier was killed and two others were injured when Taliban fighters from Afghanistan attacked a check post in Upper Dir.