The Taliban released a video Wednesday showing the bodies of what it claimed to be members of the Pakistani army and Pakistani paramilitary force, CNN reported.
A senior Pakistani military official, speaking on the condition of anonymity, confirmed the bodies in the video were Pakistani troops.
The soldiers were on patrol Friday in the Upper Dir district of Pakistan, near the Afghan border, when they were ambushed by a group of 100 militants from the Pakistani Taliban and other groups, the official said.
About 15 militants were killed in the fight, but 17 Pakistani soldiers were captured, the official said.
"It was very sad but it won't demoralize our troops," he said.
Since 2010, more than 100 Pakistani soldiers have been killed by militants based in Afghanistan, the official said.