Four people were killed when a suicide bomber posing as a legal clerk blew himself up and his companion opened fire at a courthouse in northwest Pakistan on Monday, officials said.
The attackers stormed the crowded court complex in the city of Peshawar, less than two months before
expected national elections.
A security guard who was injured told AFP how the two young men had tried to get past his checkpoint.
"They introduced themselves as court clerks and refused a body search. One of them pulled out a pistol and fired on me after I insisted on a search," Tahir Khan, 36, said from hospital.
"I was hit on my right arm. Then I shouted and policemen arrived and firing started. After some time, I heard a blast but I was bleeding and was later taken to hospital."
Sayed Jameel Shah, a spokesman for Peshawar's main Lady Reading Hospital, said it had received four bodies and was treating 25 injured people, including four police and seven lawyers.
Local TV footage showed shards of glass and broken window scattered on the floor of a court building with shattered cabinet doors.
"One suicide bomber blew himself up in the court of an additional sessions judge. One other man was shot dead by police," said senior police officer Masood Khan Afridi.
"It was an act of terrorism and the target was the judicial complex," he added. "We have cleared the whole area."
Afridi denied reports that some judges and lawyers had been held hostage inside the courts.
The nuclear-armed country of 180 million is due to elect new leaders by mid-May. But Taliban attacks and record levels of violence against the Shiite Muslim minority have raised fears about security for the polls.
"Terrorists have attacked at a time when general elections are very near and the atmosphere for election is smooth," said the information minister for Khyber Pakhtunkhwa province, Mian Iftikhar Hussain.
"It could be an attempt to disturb the peaceful atmosphere but elections should never be postponed."
Pakistan's Prime Minister Raja Pervez Ashraf on Saturday hailed parliament's historic completion of a full term in office as a victory for democracy as he gave his farewell address to the nation.
The polling date has yet to be announced but officials say the Election Commission has recommended May 8, 9 or 10.
The attack is the second in Peshawar in less than a month. Militants including a suicide bomber attacked the office of a senior official there on February 18, killing six people.
The heavily-guarded court complex is in front of a five-star hotel and close to government and official buildings.
Khyber, part of Pakistan's semi-autonomous tribal belt on the Afghan border, is in the grip of intensified fighting as part of a long-running military operation against the Taliban and other Islamist insurgents.
© Copyright © 2013 HT Media Limited. All Rights Reserved.