The bombing was the sixth in less than two weeks in and around Peshawar, the largest city in the northwest. The attacks have killed more than 80 people.
Police officers were searching a man at the gate of the city's lower court when he detonated explosives on his body, government official Sahibzada Anees said.
Several damaged motorbikes were strewn about the site, and firefighters sprayed water on a charred, smoking white car.
Dr. Saib Gul said 16 bodies had been taken to the city's Lady Reading Hospital and that 26 people had been wounded. At least three of the dead were police.
"These attacks will not deter us in our fight against these beasts who are killing our children,'' said Bashir Ahmad Bilour, senior minister of the North West Frontier Province.
The army launched its offensive against the Pakistani Taliban in South Waziristan in mid-October. It has retaken many towns in the region, but the militants say they avoided fighting and will now begin a guerrilla campaign.
The United States has welcomed the assault, but wants the army to do more against the insurgents in the border area blamed for violence across the border in Afghanistan.
Pakistan officials flagged the offensive in South Waziristan several months before it actually began, something Bilour claimed allowed the militants to escape and plan the current wave of terror.
"Unfortunately the announcement of the operation in Waziristan prior to the actual operation caused this problem,'' he said. ``They (the militants) are hiding in villages surrounding Peshawar and make their way in despite security.''
Since the beginning of October, more than 300 people have been killed in bombings and militant raids on government, civilian and western targets in the country, most of them in the northwest.
The bomb explosion occurred hours after missiles fired from a suspected U.S. drone killed three suspected militants in Shana Khuwara village in North Waziristan, another region close to the Afghan border region where al-Qaida and Taliban hold sway.
The missiles hit a house owned by a local tribesman just after midnight, said two intelligence officials, speaking on condition of anonymity because they were not authorized to talk to the media.
Ahmed Noor Wazir, who witnessed the attack, said rescuers pulled three dead bodies and four badly wounded men from the rubble of the house, which was being used by Taliban militants.
Shana Khuwara village is not far from the border with South Waziristan. Many militants are believed to have fled to North Waziristan to escape the fighting.
It was the third suspected drone strike since Pakistan launched the operation in mid-October. The pace of the attacks has slowed since the offensive began, possibly to avoid the perception that the U.S. is aiding the Pakistani army with the operation.
Anti-American sentiment is pervasive throughout Pakistan, and the drone strikes are unpopular because they often kill innocent civilians.
The Americans rarely discuss the missile strikes, and although the Pakistanis publicly condemn them as violations of their sovereignty, many analysts believe the two countries have a secret deal allowing them.