At least 40 people were killed and 327 others were injured when a truck filled with explosives blew up in the Afghan capital on Tuesday, officials said.
The bombing appeared to target the VIP protection unit compound, which provides security for high-ranking Afghan officials.
Following the bombing, which occurred in a crowded area in the heart of Kabul, at least one attacker exchanged gunfire with security forces.
“The area has been cleared of insurgents and the attack is over,” said Basir Mujahid, a spokesman for the Kabul police.
Mujahid said there were only two attackers, one who blew up the truck and another who exchanged gunfire with Afghan forces.
"At least 15 personnel [from the protection unit] were killed in the incident," said a National Directorate of Security (NDS) official, speaking anonymously.
The injured were taken to hospitals around the city, said Ismail Kawusi, a spokesman for the Health Ministry.
President Ashraf Ghani condemned the attack, which he said "clearly shows the enemy's defeat in face-to-face battle" with national security forces.
Taliban militants claimed responsibility for the attack.
"Following the first blast, a number of mujahideen entered the directorate, fighting ensued, and there were heavy casualties to the slave enemy," spokesman Zabihullah Mujahid said on Twitter.
The attack was the deadliest in the capital since a truck bomb in August killed 15 and wounded more than 200 people.
The Taliban announced the start of their spring offensive last week before launching coordinated attacks in several provinces.