The blast demolished a wall in front of the government building in a working class residential neighbourhood, smashed its structure and left gaping holes exposing its offices.
Eleven of the injured were police and soldiers.
Glass from blown-out windows littered the surrounding streets in the Shubra el-Kheima neighbourhood, at the northern entrance to the capital.
Ambulances and fire engines 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.
Emergency aid chief Ahmed al-Ansari said the wounded were taken to nearby hospitals. Wrecked cars stood around the building as security forces carrying assault rifles patrolled the streets and set up roadblocks to keep residents away.
A crater marked the blast’s apparent position, while a car engine sat where it landed on the other side of street.
IS claimed responsibility for the car bombing, saying on its Al-Bayan radio station that “soldiers of the caliphate” carried it out. A statement issued by the IS 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 IS affiliate based in the northern Sinai Peninsula.
Access to the area was highly restricted, even in the minutes following the blast, with police discouraging any approach.
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 Defence Ministry statements.
Egypt has lacked a legislature for three years, and since being elected a little over a year ago, Mr 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 upmarket Cairo neighbourhood 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.