A car bomb aimed at a paramilitary convoy has killed at least 16 people and wounded 20 others on the outskirts of the northwestern city of Peshawar, an official said.
At least two children are among the dead in Sunday's attack.
Javed Khan, a local official, said that one policeman was also among the dead in the attack at Badaber, south of Peshawar.
"This is a very sad incident. There have been targeted operations in that area in the last few days and we have arrested many terrorists from that area," Khan said.
Police said a large car bomb was placed close to the Badaber police station and detonated by remote control.
It was not immediately clear whether anyone from the paramilitary Frontier Corps, the target of the attack, had been killed.
"So far, we have reports that two Frontier Corps soldiers have been injured. We don't know about any other losses," a military official told the AFP news agency on condition of anonymity.
The attack happened not far from the semi-autonomous tribal belt where Taliban and al-Qaeda-linked groups have bases, as British Prime Minister David Cameron visited the capital Islamabad.
There was no immediate claim of responsibility but the Pakistani Taliban frequently targets security forces as part of a seven-year campaign that has killed thousands.
Pakistani Prime Minister Nawaz Sharif condemned the attack.
"Pakistan has suffered the most in terms of human and financial losses. We are, therefore, resolved to tackle the menace of extremism and terrorism with renewed vigour and close cooperation with our friends," he said after his talks with Cameron.
Pakistan's government, which took office in June after landmark elections, faces an array of problems including a moribund economy and threats from armed groups.
Sharif has previously advocated peace talks with the Taliban and criticised US drone strikes, echoing long-held complaints that the US campaign violates national sovereignty.