At least 13 people were killed and 50 wounded in a bomb attack on a district court in northwestern Pakistan.

Haris Habib, the chief rescue officer in the city of Mardan in Khyber Pakhtunkhwa Province, said on September 2 that the bodies of police, lawyers, and others were recovered.

Reports say the attacker first threw a grenade at the court entrance and then blew himself up at the main gate.

Some of the wounded are reportedly in critical condition.

A spokesman for the extremist Muslim group Jamat ul-Ahrar, an offshoot of the Pakistani Taliban, claimed responsibility for the attack.

Pakistani Prime Minister Nawaz Sharif said the bombing would "not shatter our unflinching resolve in our war against terrorism."

"These receding elements are showing frustration by attacking our soft targets. They shall not get space to hide in Pakistan," he said in a statement.

Mardan city police official Faisal Shahzad described the attack to Radio Mashaal.

"[The suicide attacker] was intercepted by police at the walk-through gate of the session courts...[and] threw a hand-grenade at the policemen, who [were] injured in the blast. The injured policemen opened fire and chased him."

He said one policeman shot him dead and that the attacker's suicide belt exploded at that time.