Islamic State claimed responsibility for a suicide attack on a compound of Afghanistan's national intelligence agency in Kabul on Monday, that killed at least five people and wounded two.

The blast comes a week after the group claimed an attack on a training facility of the same agency, the National Directorate for Security, in Kabul that ended when the attackers were killed before causing significant casualties.

In a statement issued through the group's Amaq news agency, Islamic State said it was also behind Monday's attack.

In Kabul, security officials said the explosion was caused by a suicide bomber who approached the agency's entrance on foot before blowing himself up. All the casualties reported were of civilian passers-by.

Najib Danish, a spokesman for the interior ministry, said at least five people had been killed and two wounded.

Islamic State's local affiliate, which first appeared in eastern Afghanistan near the border with Pakistan in early 2015, has become increasingly active and has claimed several recent suicide attacks in Kabul.

It has frequently fought Taliban militants and has been heavily targeted by U.S. airstrikes and Special Forces operations in its main stronghold in Nangarhar province.

But there remains considerable uncertainty about how the group operates and the exact nature of its connections with Islamic State in Iraq and Syria.