A roadside bomb killed a Pakistani general and another officer on Sunday near the border with Afghanistan, the Pakistani army said, rare high-ranking casualties in Pakistan's war against militants.
Major General Sanaullah Khan, along with a lieutenant colonel and another soldier were killed in the Upper Dir district after visiting an outpost near the border, the army said.
"Pakistan army has made substantial sacrifices to protect the nation against the menace of terrorism and such cowardly acts by terrorists cannot deter the morale of our armed forces," Prime Minister Nawaz Sharif said in a statement.
The attack comes after weeks of discussions within Sharif's government about whether to pursue peace talks with the Pakistani Taliban, who are separate from Afghanistan's Taliban but allied with them.
Last week, all major political parties held a conference on the issue and agreed that talks should be pursued.
But it is not clear when talks might begin, who might take part or if they would be held under any conditions.
The killing of Khan and the other two would likely make it more difficult for the government to enter negotiations.
The Pakistani Taliban, an umbrella group of different factions, have said they will have their own meeting to decide whether to negotiate with the government. Analysts say it might be difficult for them to reach an agreement.
The Taliban said last year that they would only consider talks if the government imposed strict Islamic law and went to war with old enemy India.
But Sharif's government, which came to power this year, has made improving ties with neighbouring India a priority.
Whatever the Taliban demand, the killing of a major general and other officers will make it more difficult for the government to pursue talks with the militants.