A bomb Sunday killed four Pakistani soldiers as they searched for militants linked to the kidnapping of a US-Canadian family who were freed last week.
The incident happened near the Kharlachi checkpoint in Kurram district in the restive tribal belt bordering Afghanistan.
The family were being held by the Taliban-allied Haqqani network in the tribal area until they were rescued during a Pakistani military operation Wednesday.
"Four security force troops including a captain embraced shahadat (martyrdom) while three others sustained injuries when an improvised explosive device went off," the military said in a statement.
"The troops were part of a search party for handlers of the rescued foreigners," it added without offering further details.
Officials told AFP the search party belonged to the Frontier Corps, a paramilitary force that provides security in Pakistan's tribal belt.
Joshua Boyle and his American wife and three children were freed after five years of captivity at the hands of the Haqqani network, a notorious militant group that operates on both sides of the Afghanistan-Pakistan border.
The Haqqani network is headed by Sirajuddin Haqqani, who is also the Afghan Taliban's deputy leader.
In a chilling statement on the family's arrival in Toronto, Boyle accused his kidnappers of murdering their infant daughter and raping his wife, Caitlan Coleman.
Pakistan, which has long been accused of having links to groups such as the Haqqanis, has faced increased pressure from Washington to crack down on militants after it was lambasted by US President Donald Trump in August.
Following the family's release, Trump tweeted that relations were improving and thanked Pakistan for "their cooperation on many fronts".