The court building were the first blast took place is located on Khyber Road, across the street from the Pearl Continental Hotel, which was the target of a deadly bomb attack in June.

"It happened outside the judicial complex," Abdul Wali, a police officer, told the Reuters news agency.

'Attacker on foot'

Sahibzada Anees, the head of Peshawar city administration, said that a suicide bomber carried out the attack.

"The attacker was on foot and blew himself when guards tried to search him at the gates of the court," he said.

In depth

  Video: On Pakistan's frontline
  Video exclusive: South Waziristan's civilians suffer
  Video: Civilians flee Pakistani army offensive
  Video: Security crisis in Pakistan
  Video: Pakistan army HQ attacked
  Profile: Pakistan Taliban
  Witness: Pakistan in crisis
  Riz Khan: The battle for the soul of Pakistan

Three policemen were among the dead, Anees said.

Up to 17 bodies had been brought to Peshawar's Lady Reading Hospital, Sahib Gul, the most senior official, said.

Al Jazeera's Kamal Hyder, reporting from Islamabad, said the attacker was trying to enter the court's complex when he was stopped by security personnel.

"The attack took place at 10:20am [local time] when the Khyber Road is jam packed with traffic as well as people," he said.

"As that suicide bomber tried to enter the court, the police decided to conduct a search at which point he detonated the device, with devastating consequences."

A wave of attacks have targeted police checkpoints, police stations and the provincial headquarters of Pakistan's spy agency, ISI, this month, killing dozens of people.

The Pakistani Taliban has claimed responsibility for several of the attacks, but Yusuf Reza Gilani, Pakistan's prime minister, said that many of the group's commanders were on the run.

"They are using the weapons they have scattered here and there," he said.

"God willing, it will take some time, but I assure you things will return to normal soon."

The blast comes as military battles members of the Tehreek-e-Taliban Pakistan, one of the main anti-government groups, in the country's semi-autonomous tribal region of South Waziristan.

The military launched its offensive nearly three weeks ago, pitting about 30,000 troops against an estimated 10 to 12,000 Taliban fighters in South Waziristan.