Islamic State has claimed responsibility for a mass shooting that killed at least 18 worshippers at a shrine in the Afghan capital, raising fears of sectarian violence after a string of attacks on the country's Shi'ite minority.
The claim to Tuesday's attack, released online on Wednesday, came as the community observed Ashura, one of its holiest days, although commemorations have been subdued because of security fears.
On Wednesday afternoon, an explosion outside a mosque in northern Afghanistan killed at least 14 people and wounded 24 at a similar gathering. There was no immediate claim of responsibility for that assault.
Islamic State had earlier targeted members of Kabul's Shi'ite community in a suicide bombing in July that killed more than 80 people and wounded 130.
The attacker in Kabul, said to be wearing a police uniform, entered the Karte Shakhi mosque on Tuesday night and opened fire on a crowd of Shi'ite Muslims marking Ashura, which commemorates the seventh-century death of a grandson of the prophet Mohammad.
In its statement, Islamic State said the attacker detonated a suicide vest after firing all his ammunition, but security forces said they shot the man.
A Reuters video shows the suspected attacker's body intact, with no sign of an explosive vest.
Relatives carried dead and wounded victims away from the blood-stained steps of the mosque, which is known for its bright blue tiles and domes.
The dead included four women and two children, said the United Nations, which condemned the attack as a violation of international law.
"This attack, deliberately targeting a large group of civilians exercising their right to freely manifest their religion in worship, observance and practice, is an atrocity," the UN said.
It put the tally at 18 civilians killed and 50 wounded, though some witnesses said the toll could be higher.
Mourners buried several of the victims, including a four-year-old girl, on Wednesday.
Ashura is typically marked by processions that include self-flagellation by some worshippers, but government warnings of possible attacks prompted more subdued events this year.
The Taliban, who have been waging a 15-year insurgency against the Western-backed government and often conduct attacks in Kabul, denied involvement in the shooting.