KABUL, Afghanistan — A suicide bomber struck outside the Afghan national intelligence agency headquarters near the presidential palace in the capital Monday, killing six civilians, officials said.

The Islamic State militant group asserted responsibility for the attack through its Amaq News Agency and said “30 elements from the Afghan National Directorate of Security” were killed.

The bombing comes a week after militants stormed a training center of the agency in Kabul.

Interior Ministry spokesman Najib Danish said three other civilians were wounded in Monday’s rush-hour attack in Shash Darak, a Kabul neighborhood with several government offices and a heavy security presence.

Police cordoned off the area, which links eastern parts of Kabul to the city center. Witnesses said the attack occurred outside the main entrance to the security compound.

“Uniformed forces closed off the main roads. Ambulances were seen leaving the scene, apparently taking casualties to hospitals,” said Qadir Salem, a bystander.

Mariam Attaie, a commuter who was heading to work when the attack occurred, wrote on her Facebook page: “My day has been started with sorrow and grief, I was just few meters away from today’s explosion, my ears stopped working for few minutes.”

In recent months, Kabul has been repeatedly targeted by suicide bombers with ties to the Islamic State and the Taliban. The Islamic State has been ratcheting up attacks on government buildings and, most recently, Shiite mosques in Kabul, exacting a heavy civilian toll.

Follow the Bangor Daily News on Facebook for the latest Maine news.