A massive car bomb claimed by Islamic State militants ripped into a national security building in a working class residential neighborhood in Cairo early Thursday, wounding at least 29 people and blowing the facades off nearby buildings.

The blast, which went off around 2 a.m., demolished a wall in front of the government building, smashed its structure and left gaping holes exposing its offices. Of those hurt, 11 were police and soldiers. No deaths were reported.

Glass from blown-out windows littered the surrounding streets in the Shubra el-Kheima neighborhood, at the northern entrance to the capital.

Ambulances and fire trucks rushed to the scene, which was flooded with water from pipes broken by what authorities said were high explosives. The explosion could be heard and felt across the city. State news agency MENA reported the casualties hours later.

Emergency aid chief Ahmed al-Ansari said the wounded were evacuated to nearby hospitals. Wrecked cars stood around the building, as security forces carrying assault rifles patrolled the streets and set up roadblocks to ward off hysterical residents. A crater marked the blast's apparent position, while a car engine sat where it landed on the other side of street.

The Islamic State group claimed responsibility for the car bombing, saying on its Al-Bayan radio station that "soldiers of the caliphate" had carried it out. A statement issued by their affiliate in Egypt and circulated by supporters online said it was to avenge the execution of six convicted militants in May.

A similar statement emerged last month following a bombing outside the Italian Consulate in Cairo.

Egypt has seen a surge of assaults on security forces since the 2013 military overthrow of Islamist president Mohammed Morsi. Previous large-scale attacks have been claimed by an Islamic State affiliate based in the northern Sinai Peninsula.

Inside his ruined clinic next door to the security building, plastic surgeon Gawad Mahmoud lamented Egypt's troubles since the military ousted Morsi, the country's first freely elected president, amid massive protests against his divisive yearlong rule.

"We were here painting the office, and then it went off. It was like an earthquake, it blew the doors off and smashed all the windows in," he said. "The explosion sounded professional, it wasn't small-time. We are not living in a normal state here."

Access to the area was highly restricted, even in the minutes following the blast, with dozens of policemen, plainclothes and uniformed, discouraging any approach. At the site, press credentials of the few foreign journalists who managed to arrive were checked repeatedly by authorities.

Egypt has been wracked by a wave of attacks since President Abdel-Fattah el-Sissi overthrew Morsi and launched a heavy crackdown against his supporters and dissent in general.

Last weekend, he decreed a new anti-terrorism law presented amid a wave of violence and killings this summer. The far-reaching new law sets a sweeping definition for who can face a harsh set of punishments. Journalists can be fined for reporting that contradicts Defense Ministry statements.

Egypt has lacked a legislature for three years, and since being elected a little over a year ago, el-Sissi has single-handedly passed dozens of laws.

The Cabinet approved the draft anti-terrorism law last month, two days after a car bomb in an upscale Cairo neighborhood killed the country's prosecutor general, Hisham Barakat.

On the day it was approved by ministers, Islamic militants launched a multi-pronged attack attempting to seize a northern Sinai town, hitting the military with suicide attacks and battling soldiers for hours.

The violence has largely been confined to the restive northern part of the Sinai Peninsula, but Cairo and other parts of the mainland have been rocked by a series of mostly small-scale explosions targeting police.

A huge truck bomb in January 2014 targeting Cairo's security headquarters killed four people and damaged a nearby museum dedicated to Islamic arts and history.

A month earlier, a car bomb tore through a security headquarters in the Nile Delta city of Mansoura, killing 16 people, nearly all policemen. Ansar Beit al-Maqdis, as the Sinai outfit was known before it pledged allegiance to the IS group last year, claimed responsibility.