The attacker targeted Doaba police station in Hangu district of Khyber-Pakhtunkhwa region.
The region, which borders the restive Orakzai and Kurram tribal regions, has been hit by sectarian violence and frequent militant attacks.
A police official and four civilians were among the dead, police officer Mir Chaman Khan said. Twenty-five injured people, including policemen, were taken to nearby hospitals.
The bomber wanted to hit the police station building but was unable to do so because of barricades on the road leading to it, officials said.
Part of the police station collapsed after the blast, which also damaged 10 nearby homes. Police cordoned off the area and started a search operation. Local residents joined rescue teams to pull bodies and the injured from the rubble.
No group claimed responsibility of the attack. Taliban militants are usually blamed for such attacks. This was the second attack on police in the region in two days. Yesterday, six policemen were injured in a roadside bomb attack near a police van. Taliban militants are very active in Hangu district.