An explosion reverberated in central Islamabad just after 9 a.m., followed by bursts of gunfire. A judge and several lawyers are reported to be among those killed and at least 24 people were wounded.
No group has yet claimed responsibility for the attack.
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.
Even as the Taliban declared willingness to talk peace, almost daily attacks have continued around Pakistan in past weeks, showing that the central Taliban leadership is not entirely in control of its operations.
"We have already declared a ceasefire for a month and we stand by our promise," a Taliban spokesman said.
The judge, Rafaqat Awan, was killed on the spot.
During Monday's attack, two suicide bombers blew themselves up outside the courtroom where a hearing had just started, police said.
Two other attackers were killed in the ensuing gun fight with police. Police said gunmen fired at random targets in the area after the initial explosion.
Shortly afterwards, police blocked entry and exit points to the area, a maze of narrow, dusty streets lined with one-room shops and offices.
Commandos in camouflage knocked on doors and secured street corners as they combed the area for more militants.
Police secured the area an hour later and the market resumed normal operations.
RA/NJF