A suicide bomber believed to be as young as 12 struck Kabul's heavily fortified diplomatic quarter on Tuesday and killed at least five people, showing that militants can still hit the heart of the city despite tighter security.

It was the first attack targeting the Afghan capital's "Green Zone" since a massive truck bomb ripped through the area on May 31, killing or wounding hundreds, and prompting authorities to strengthen protection.

The Islamic State group claimed responsibility for Tuesday's attack, which follows a spate of suicide assaults by Taliban and IS insurgents on security installations and mosques in recent weeks.

A Western security source told AFP the attacker appeared to have been targeting workers leaving an Afghan defence ministry facility inside the heavily protected zone.

Health ministry spokesman Ismail Kawoosi told AFP that at least five people had been killed and 20 wounded, including women.