ISLAMABAD — Two suicide bombers armed with grenades stormed Islamabad’s district court complex Monday morning, killing 11 people and wounding 29. It was the deadliest terrorist attack in years in Pakistan’s capital, which has been largely spared from violence.
The attack occurred at 8:30 a.m. when the men, described by police as ‘‘professional terrorists,’’ entered the complex and began firing assault rifles and lobbing grenades at judges, lawyers, and residents gathered for civil-court proceedings.
Witnesses said the men fired indiscriminately, creating panic in one of Pakistan’s safest and most heavily guarded cities.
‘‘Everyone was running to save their life, and it was a horrible scene,’’ said M. Yaseen, a 46-year-old trader who had gone to the courthouse to process paperwork. ‘‘I felt like I was watching a movie and this was not real.’’
The Pakistani Taliban denied responsibility for the rampage. But the violence underscored the difficulty of negotiations when numerous militant groups are operating in Pakistan. And it raised questions of whether the Taliban can control some of their factions that may oppose talks.
The attack, which killed a district court judge, at least three attorneys, and the chief constable, occurred less than 24 hours after Pakistan’s government said it had to agreed to a one-month unconditional cease-fire with the Pakistani Taliban.
The cease-fire was supposed to head off a Pakistani military operation against militant strongholds in northwest Pakistan and allow for the resumption of preliminary peace talks between Prime Minister Nawaz Sharif’s government and Taliban representatives. Instead, Sharif and the Pakistani military are once again being tested over how much bloodshed they are willing to accept in their hopes of reaching a negotiated peace agreement.
The assault on the court complex lasted 45 minutes and ended only after the gunmen blew themselves up in front of a courtroom.
The dead included Rafaqat Awan, a prominent district court judge. Shabir Hussain, 30, a lawyer, said he saw the gunmen shoot and kill Awan.
‘‘They were very calm and composed and seemed to be well-trained militants,’’ said Hussain. ‘‘We heard people crying all around, lawyers lying injured on the ground with blood around them.’’
While Taliban leaders quickly distanced themselves from the attack, a former faction of the group called Ahrar ul Hind claimed it carried out the attack to show its displeasure with the peace process.
‘‘Our fight will continue,’’ Asad Mansoor, a spokesman for the group, said in an interview. ‘‘We will carry on attacks on urban areas, police, and markets until there is the complete imposition of sharia law.’’
Analysts said that although some members of the Pakistani Taliban may want to negotiate a peace deal, other factions or militant groups do not.
Interior Ministry’s Chaudhry Nisar Ali Khan, speaking in Parliament after the attack, called on the Taliban to distance themselves from the renegade groups and help bring the planners of the attack to justice, the Associated Press reported.
Before declaring it would halt airstrikes, Pakistan had targeted militants and foreign fighters near Afghanistan, as well as in Khyber Pakhtunkhwa province.
The airstrikes began after a faction of the Taliban executed 23 Pakistani soldiers who had been held captive since 2010.
Pakistani officials and analysts had predicted that the airstrikes would be quickly followed up by a major military ground assault aimed at dislodging militants affiliated with the Pakistani Taliban, the Haqqani network, and Al Qaeda. But just when it appeared that a ground offensive could be imminent, the Pakistani Taliban said Saturday it wanted a one-month cease-fire with government forces.
With more than 40 militant groups believed to operate inside Pakistan, analysts say Pakistan’s government faces a daunting challenge in trying to secure the country through a negotiated settlement.
‘‘There are forces who don’t want this process to proceed,’’ said Imtiaz Gul, a Pakistani security analyst.
In a report submitted to the National Assembly last week, the Interior Ministry said 900 people have been killed in more than 1,700 attacks across Pakistan in the past six months.
Although there was a spate of attacks in Islamabad from 2006 to 2009, including the 2008 bombing of the Marriott Hotel that killed 52 people, the city has been relatively secure in recent years.