- The Pakistani Taliban claim responsibility for the attack
- They say it was retaliation for the execution of Mumtaz Qadri this month
At least 31 other people were injured in the attack in Charsadda district, said district police Chief Sohail Khalid, adding that five women, four children and five police officials are among the injured.
A spokesman for the Pakistani Taliban claimed responsibility for the attack, saying it was in retaliation for the execution of Mumtaz Qadri on February 29.
Qadri was convicted of killing the governor of Punjab province in 2011.
The bombing incident began about noon local time, when the attacker opened fire outside the gates of the Charsadda court, Khalid said. When security officers tried to stop him from getting inside, the gunman detonated explosives that were strapped to his body.
Prime Minister Nawaz Sharif
issued a statement condemning the attack.
"The nation is united in its commitment to wipe out this menace from our soil," the statement read. "Those who embraced martyrdom in the line of duty sacrificed their today to safeguard a peaceful tomorrow for our future generations, and they deserve gratitude and recognition of the highest degree."