The Jamatul Ahrar, a splinter group of the outlawed Tehreek-i-Taliban Pakistan (TTP), claimed responsibility for the attack in an email sent to journalists, saying the attack was carried out to avenge the hanging of Mumtaz Qadri, killer of former Punjab Governor Salman Taseer.
The blast left 14 people injured, while two police personnel and a woman were among the dead.
District Police Officer Sohail Khalid told DawnNews that the attack was carried out by a suicide bomber.
The attacker was intercepted by policemen stationed at the court gate as he was attempting to enter the sessions court premises.
The cops fired at the attacker who detonated his explosives with a loud bang. At least eight people, including two policemen were killed while 14 others were wounded in the attack, the DPO confirmed.
Eyewitnesses at the site said they heard firing after a loud blast.
The casualties were shifted to Shabqadar Hospital. Hospital administration said they received seven bodies.
At the time of the explosion, the courts were crowded after a break over the weekend.
Some vehicles parked in the vicinity of the blast site caught fire. Efforts are being made to put the fire out.
Security and emergency teams reached the blast site and sealed the area.
Awami National Party (ANP) Zahid Khan, talking to DawnNews after the blast, criticised the provincial government for ‘taking inadequate security measures’.
Shabqadar tehsil is close to Mohmand tribal region, which is one of seven semi-autonomous tribal regions in the northwest, where Pakistani Taliban and Al Qaeda-linked militants were said to have carved out strongholds.
The incident comes at a time when law-enforcement agencies are said to be making gains in implementation of the National Action Plan (NAP) and taking counter-terrorism measures across the country.
A total of 2,159 terrorists have been killed and 1,724 arrested, data from the interior ministry showed, since NAP was launched following the TTP-claimed attack on the Army Public School in Peshawar on Dec 16, 2014.
The number of attacks in Pakistan has fallen around 70 per cent, due to a combination of the military offensive against Taliban bases along the Afghan border and government initiatives to tackle militancy, but attacks on security and civilian targets continue to occur occasionally. -Dawn