In an attack on a military hospital in Kabul on Tuesday, at least 19 people lost their lives while 50 others were wounded.
The attack got under way when a suicide bomber detonated his explosives near the entrance of the sprawling site.
Gunmen then broke into the hospital grounds, firing their weapons there, the Taliban said.
“Nineteen dead bodies and about 50 wounded people have been taken to hospitals in Kabul,” a health ministry official who asked not to be named said.
The Taliban spent 20 years waging an insurgency against the ousted US-backed government.
Now they face the struggle of bringing stability to Afghanistan, which has been hit in recent weeks by a series of bloody assaults claimed by the Islamic State group’s local chapter.
Tuesday’s attack has not yet been claimed by any group.
“All the attackers are dead. The attack was initiated by a suicide bomber on a motorcycle who blew himself up at the entrance of the hospital,” a Taliban official from the media team said.
“Some attackers entered the hospital compound.”
Two explosions targeted the hospital area, he had earlier said in a statement.
A second explosion was heard some 30 minutes after the first was reported.
“I heard a big explosion coming from the first checkpoint. We were told to go to safe rooms. I also hear guns firing,” a doctor at the Sardar Mohammad Daud Khan hospital in Kabul said while the attack was being carried out.
“I can still hear gun firing inside the hospital building. I think the attackers are going from room to room… like the first time it was attacked,” the doctor added.
Ambulances speeding through Kabul
The hospital, which treats wounded soldiers from both the Taliban and former Afghan security forces, was previously attacked in 2017, when gunmen disguised as medical personnel killed at least 30 people in an hours-long siege.
Although both IS and the Taliban are hardline Sunni Islamist militants, they differ on details of religion and strategy.
IS have claimed four mass casualty attacks since the Taliban takeover on August 15, including suicide bomb blasts targeting Shiite Muslim mosques. The group regards Shiite Muslims as heretics.
In the 2017 attack on the military hospital, militants went room to room killing people, switching to knives when they ran out of ammunition.
That attack was claimed by the Islamic State group, and the Taliban denied responsibility.
However, survivors said the attackers chanted “Long live Taliban” in Pashto and attacked all but two wards on the hospital’s first floor where Taliban patients were admitted.