Dozens were wounded when a car bomb exploded overnight near a security building and a courthouse in a Cairo suburb. Egyptian authorities have mounted the toughest security crackdown against militants in the country's history. (Reuters)

The Islamic State claimed Thursday it carried out a massive car bombing that targeted Egyptian security forces in Cairo, calling the operation revenge for the deaths of some of its members earlier this year.

Six policemen were injured in the predawn attack on a branch of the National Security Agency, the country’s domestic spy service, in the Cairo suburb of Shubra al-Kheima, the Interior Ministry said.

The powerful blast — which could be heard across several Cairo districts — has raised fears of stepped up insurgent attacks in the Egyptian capital. Islamists and other militants have waged an increasingly deadly campaign against Egyptian security forces since a military coup ousted Islamist President Mohamed Morsi in 2013.

Among the factions is a group, based in Egypt’s Sinai Peninsula, that has pledged loyalty to the Islamic State.

Map: What a year of Islamic State terror looks like

In a message posted online, the Islamic State said its “soldiers of the caliphate were able to strike the state security building in the area of Shubra al-Kheima with a car full of explosives.”

A bomb-rigged vehicle was parked outside the security offices, about six miles from the central Tahrir Square. The driver fled on a motorcycle before the explosion, the Interior Ministry said in a statement.

Egyptian insurgents have frequently targeted security installations. The Islamic State said Thursday’s attack was in retaliation for “Arab Sharkas,” a reference to the site of a deadly shootout between militants and security forces in a village close to Shubra al-Kheima in 2014.

The hours-long gunbattle was touched off by a raid on a timber workshop believed linked to militants who later forged ties with the Islamic State. Militants and senior army officers were among those killed.

In May, Egypt executed six men it said belonged to the cell in Arab Sharkas. Human Rights Watch has said that three of those men were already in custody when the gun battle took place.

Early Thursday, the private Egyptian television channel CBC aired video showing extensive damage to buildings in the Shubra district.

In January 2014, jihadists now loyal to the Islamic State claimed a car bomb attack outside a security directorate in Cairo, causing extensive damage.

Egyptian policemen and security forces patrol the scene where a bomb detonated next to a national security building in the Shubra neighborhood of Cairo, early 20 August 2015. (Oliver Weiken/EPA)

In June, a powerful car bomb exploded and killed Egypt’s top prosecutor, Hisham Barakat, in the heart of Cairo. A new group calling itself the “Tahrir Brigades” claimed responsibility for that operation earlier this month. The claim, which said the group was made up of defected Egyptian army officers, could not be verified.

Read more:

Syria says Islamic State militants beheaded a noted archaeologist

Map: The world according to the Islamic State

This town has resisted Islamic State for 18 months. But food is running low.