A suicide bomber struck outside the Afghan national intelligence agency headquarters near the presidential palace in the capital on 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.

[Islamic State forces attack TV station in heart of Kabul, leaving 2 dead]

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."

[Afghan president is under siege as violence, joblessness persist]

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.

Read more:

U.S. wants to build ‘tsunami of air power’ in Afghanistan, but impact is years away

Taliban attacks in Afghanistan kill more than 70 people

Today’s coverage from Post correspondents around the world

Like Washington Post World on Facebook and stay updated on foreign news