Cairo (AFP) - A powerful car bomb blast tore through a Cairo police building Thursday injuring at least 29 people in the latest attack claimed by the Islamic State group against Egyptian security forces.

Six policemen were among those wounded in the explosion but officials said none of the injuries were life-threatening.

Described by a resident as "like an earthquake", the overnight explosion shook the working-class Shubra district of northern Cairo, severely damaging the front of the police office and shattering the windows of nearby buildings.

The attack came only days after President Abdel Fattah al-Sisi imposed a tough new anti-terrorism law as he struggles with a jihadist insurgency spearheaded by the local branch of IS.

Egypt's interior ministry said in a statement that a car had exploded outside the police building, which houses a centre for investigating threats to national security, in the early hours of Thursday morning.

It said that prior to the explosion a man was seen parking the car in front of the building and escaping on a motorbike that had followed the vehicle.

Health ministry spokesman Hossam Abdel Ghaffar said six policemen and 23 civilians had been wounded but none of the injuries were serious.

"One policemen suffered moderate injuries and the rest (of those hurt) had minor injuries," he said.

IS claimed responsibility for the attack in a statement posted on an affiliated Twitter account.

"The soldiers of the Islamic State managed to target a police building with a car bomb in the heart of Cairo," the statement said.

- IS revenge attacks -

It said the attack was revenge for the hanging of six members of its Egyptian affiliate -- known as "Sinai Province" -- in May.

The main jihadist group in Egypt's restive Sinai Peninsula pledged allegiance to IS, which has seized control of large parts of Syria and Iraq, last November.

The six men were convicted of killing soldiers in attacks carried out in the months after the army's ouster of Islamist president Mohamed Morsi in 2013.

Story continues

An AFP reporter saw a wide crater left behind by the blast near the four-storey concrete building. The building's windows were blown out and its facade was left cracked and crumbling, while parts of a wall surrounding it were destroyed.

One of the two guard posts at the entrance of the building was also destroyed.

A blackened car engine lay metres from the entrance and broken metal vehicle parts lay scattered on the ground.

"The front glass window of my apartment broke and two doors fell down. It was like an earthquake," Hady Gad, a resident living behind the building, told AFP.

Jihadists have killed scores of police and soldiers since the insurgency swelled in the wake of the overthrow of Morsi, the country's first democratically elected president who took office following the 2011 ouster of longtime ruler Hosni Mubarak.

They say the attacks are in retaliation for a police crackdown targeting Morsi supporters that has left hundreds dead and thousands jailed. Hundreds more have been sentenced to death after speedy trials.

- Tough measures -

While most of the attacks have centred on Sinai, IS has in recent months carried out more attacks in the capital, including against foreign targets.

The group claimed a car bomb attack targeting the Italian consulate in downtown Cairo on July 11 which killed a passerby.

The consulate bombing was followed by the abduction of Croatian engineer Tomislav Salopek, who IS claimed to have beheaded in a statement released earlier this month with a purported picture of his corpse.

With his security forces struggling to contain the insurgency, Sisi on Sunday ratified an anti-terrorism law boosting police and judicial powers. It also imposes hefty fines for "false" media reports on militant attacks.

Rights groups, which have accused Sisi of imposing a repressive regime, fear the new law could be used to further muzzle dissent and target critics.

The passing of the law was expedited after state prosecutor Hisham Barakat was assassinated in a car bombing in June, followed by a large-scale jihadist attack in Sinai days later.

The judiciary and security forces already had wide-ranging powers in tackling "terrorism", and Sisi's regime has been accused of using the battle against jihadists as a pretext for stifling dissent.

The law "increases authorities' power to impose heavy sentences, including the death penalty, for crimes under a definition of terrorism that is so broadly worded it could encompass civil disobedience," Human Rights Watch said Wednesday.

The foreign ministry has hit back at criticism, insisting that other countries should "respect the independence of the (Egyptian) judiciary".