A police official says the death toll in a suicide bombing at the entrance to a court building in northwestern Pakistan has risen to 17.

Ali Jan Khan says the Monday blast in the town of Shabqadar in Charsadda district killed 17 people, including two policemen and a policewoman.

He said Tuesday that the death toll rose after six of the more than 20 people wounded died in hospitals overnight.

A group affiliated with the Pakistani Taliban and calling itself Jamat-ul-Ahrar claimed responsibility, terming it an attack on the judiciary which "gives verdicts against God's divine laws."

Ahrar's spokesman Ahsanullah Ahsan has said that the court bombing was a revenge for the hanging of Mumtaz Qadri, who was executed last week for the 2011 killing of a provincial governor.