Sectarian violence: Gunman kills 14 at Kabul shrine
The claim of responsibility for Tuesday's attack, released online, came as the minority gathered to observe Ashura, one of its holiest days, in commemorations subdued because of security fears, as well as the funerals of the dead.
On Wednesday afternoon, a second explosion outside a mosque in northern Afghanistan killed at least 14 people and wounded 24 at a similar Ashura gathering.
But there was no immediate claim of responsibility for that blast.
Islamic State also targeted members of Kabul's Shia 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 Shia Muslims gathered for Ashura, which marks the seventh-century death of a grandson of the prophet Mohammed (PBUH).
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.
Mourning Afghans mark Ashura hours after shrine attack
A Reuters video shows the suspected attacker's body intact, with no sign of an explosive vest.
The dead included four women and two children, said the United Nations, which condemned the attack as an "atrocity".
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.
"We are not happy with the government and the police. They both failed to protect us and provide security for us," said one of the girl's relatives, Mohammed Hussain, who described the event as "doomsday" for the family.
The day is typically marked by processions that often include self-flagellation by some worshippers, but government warnings of possible attacks prompted more subdued observation of the event this year.
Three Afghan Taliban leaders arrested
The Taliban, who have been waging a 15-year insurgency against the Western-backed government and often conduct attacks in Kabul, had denied involvement in the shooting.
The schism between Sunnis and Shia developed after the prophet Mohammed died in 632 and his followers could not agree on a successor.
Some Sunni Muslim militants see Shia as a threat and legitimate targets for attack.
COMMENTS
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ