An Islamic State suicide bomber struck outside the Afghan Interior Ministry on Wednesday, allowing several gunmen to pass through an outer gate where they traded fire with security forces, who eventually killed the attackers, officials said.
Gen. Daud Amin, the Kabul police chief, said seven attackers were killed and that cleanup operations were underway. Interior Ministry spokesman Najib Danish said one policeman was killed and five were wounded. Danish said the attackers were wearing military uniforms.
Hours after the attack, the Islamic State group claimed responsibility for the bombing in a brief statement carried by its Aamaq news agency. The statement called it an "immersion attack" on the ministry in Kabul.
It appeared to be a rare victory for Afghan security forces, who have struggled to secure the capital in recent months.
The Taliban and a local IS affiliate have carried out scores of attacks, mainly targeting security forces and the country's Shiite minority, that have killed hundreds of people in recent years.
Both armed groups seek to establish strict Islamic rule in the country. Their relentless assaults underscore the struggles that Afghan forces have faced since the United States and NATO concluded their combat mission in Afghanistan at the end of 2014.
Elsewhere in Afghanistan, the Taliban attacked a district headquarters in the northern Takhar province, killing five security forces, according to provincial police spokesman Khalil Asir.
He said another three people were wounded in the battle Wednesday. He said 10 insurgents were killed.
In the eastern Logar province, Taliban suicide bombers attacked a police station, killing at least three policemen. Among the dead were the commander of the police station and the deputy director of traffic police for Puli Alim, the provincial capital, said Khalid Safi, a spokesman for the governor.
Another four policemen and eight civilians, including two children, were wounded in the Logar attack early Wednesday, said Shah Poor Ahmadzai, spokesman for the provincial police chief.
He said the attackers set off a suicide car bomb at the entrance to the station before three suicide bombers tried to enter. He said all three were shot and killed by security forces within minutes of the initial attack, adding that a number of nearby homes were damaged.
The Taliban claimed the attacks in both provinces.
In the southern city of Kandahar, a roadside bomb killed three people and wounded another 13, said Daud Ahmadi, spokesman for the Kandahar provincial governor. He said the victims included mechanics who had been contracted to repair Afghan army vehicles. No one immediately claimed the attack.