According to Dawn News, 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 at least 30 people injured, while two police personnel and a woman were among the dead.
Official sources at the Shabqadar Hospital told Dawn News they received 13 bodies, while the Lady Reading Hospital in Peshawar received four.
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 17 people, including two policemen were killed while 30 others were wounded in the attack.
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 Dawn News after the blast, criticised the provincial government for 'taking inadequate security measures'.