Yesterday's suicide bomb and gun attack is likely to shatter any prospect of meaningful peace talks with Taliban insurgents in the country.
The Pakistani Taliban, who have declared a month-long ceasefire to pursue peace talks with the government, immediately distanced themselves from the attack as well as a separate blast on the Afghan border which killed two soldiers.
An explosion reverberated in central Islamabad, followed by bursts of gunfire. Police said at least 30 people were wounded.
Faisal Ali, a businessman who witnessed the attack, said: "There was a blast, then there was a lot of gunfire. Gunmen were spraying bullets at everyone."
Even as the Taliban declared willingness to talk peace, almost daily attacks have continued around Pakistan in past weeks, suggesting that the central Taliban leadership is not entirely in control of its operations.
A Taliban spokesman said: "We have already declared a ceasefire for a month and we stand by our promise."
The judge, Rafaqat Awan, was killed on the spot. He had rejected a petition last year to file a murder case against former President Perzez Musharraf over his order to storm a hardline mosque in Islamabad in 2007.
Many radical Islamists hold a grudge against Mr Musharraf over the storming, in which more than 100 people were killed, and any official seen as obstructing their fight for justice is likely to be on their hit list.
During yesterday's attack, two suicide bombers blew themselves up outside the courtroom where a hearing had just started.
Two other attackers were killed in the ensuing gun fight with police. Police said gunmen fired at random targets after the initial explosion.
Shortly afterwards, police blocked entry and exit points to the area, a maze of narrow streets lined with shops and offices.
Commandos knocked on doors and secured street corners as they combed the area for more militants.