A toddler was among those rescued by Afghan security forces after an explosion ripped through the building housing the Ministry of Information and Technology in Kabul on Saturday.
Seven people were killed in the attack, which began shortly before midday when a suicide bomb was detonated at the building's entrance and was followed by gunfire.
At least three attackers battled security forces for several hours before the assault was finally suppressed in the late afternoon. More than 2,800 workers, and several children and staff at a childcare centre, were evacuated.
There was no claim of responsibility but the Taleban issued a statement denying involvement. Many such attacks have been claimed by the radical Islamic State in Iraq and Syria group.