Afghan security forces inspect the site of a Taliban-claimed deadly suicide attack in Kabul, Afghanistan, Tuesday, April 19, 2016. Armed militants in Afghanistan have staged a coordinated assault on a key government security agency in the capital Tuesday morning, killing many and wounding more than 320 people. (AP Photo/Rahmat Gul)
Afghan security forces inspect the site of a Taliban-claimed deadly suicide attack in Kabul, Afghanistan, Tuesday, April 19, 2016. Armed militants in Afghanistan have staged a coordinated assault on a key government security agency in the capital Tuesday morning, killing many and wounding more than 320 people. (AP Photo/Rahmat Gul) Credit: ap photograph

Kabul, Afghanistan — The suicide blast tore open the gates of the compound. One worker inside saw a shower of glass shards and jagged pieces of the explosive-rigged truck.

Then seconds later Tuesday — as an ash-gray cloud rose over Kabul — Taliban gunmen opened fire on Afghanistan’s equivalent of the Secret Service. For three hours, a gun battle raged even as some agents were trapped under collapsed walls and ceilings.

Just a week earlier, the Taliban vowed to escalate attacks as the Afghan weather warms.

The militants now appear to have followed through with the warnings in a shattering tally: at least 28 people killed, more than 325 injured and authorities left struggling over how Taliban attackers outwitted security patrols to carry out one of the most devastating attacks in Kabul in years.

The target — the main training ground for an Afghan intelligence unit tasked with protecting senior officials — represented a direct strike against the Western-aided government as it takes the lead role in the fight against the Islamist militants.

The raid also was a message that the reach of Taliban fighters — and their ability to stage major coordinated attacks — appears undimmed despite rifts within the group’s ranks and pressures from rival Islamic State as it seeks to expand into Afghanistan.

For leaders in Kabul, it may shatter for now any hope of reviving stalled peace talks with the Taliban, and puts President Ashraf Ghani under growing pressure from rivals over his efforts to reach out to the insurgent group.

The attack ended several weeks of relative calm in the Afghan capital. It began when a suicide bomber detonated a truck packed with explosives next to the security compound, Kabul police spokesman Basir Mujahid said.

After the explosion shredded part of the security compound, at least one gunman entered the compound, touching off a three-hour gun battle less than a mile from the presidential palace and the Defense Ministry in a densely populated part of the city.

One gunman was killed, a spokesman for the Interior Ministry said. Full details about the number of attackers and their tactics, however, remained unclear.