The Islamic State group has claimed responsibility for a suicide bombing in Kabul that targeted a Shi'ite neighborhood, killing 34 students.
Grieving families gathered to bury their dead on Thursday but even amid the sombre atmosphere there was no respite from violence, underscoring the near-daily, persistent threats in the war-battered country.
Two gunmen besieged a compound belonging to the Afghan intelligence service in a northwest Kabul neighbourhood early on Thursday, opening fire as Afghan security forces moved in to cut them off.
The standoff lasted for nearly six hours before police killed the gunmen and secured the area.
The Islamic State group, in a posting on its Aamaq News Agency, claimed more than 200 people were killed or wounded in Wednesday's suicide bombing.
The bomber, who had walked into a classroom in a one-room building at a Shi'ite educational centre in the neighborhood of Dasht-e-Barchi, where he set off his explosives, was identified as "the martyrdom-seeking brother Abdul Raouf al-Khorasani."
Afghanistan's IS affiliate is known as The Islamic State in Khorasan Province, after an ancient name of the area that encompassed parts of present-day Iran, Afghanistan and Central Asia.
The bombing also wounded 57 students, according to Health Ministry spokesman Wahid Majroh.
Earlier on Thursday, the ministry revised an earlier death toll from the attack down to 34, not 48.
Most of the victims were young men and women, high school graduates preparing for university entrance exams in the Shi'ite area's educational center.
Kabul hospitals were completely overwhelmed in the immediate aftermath of the attack as officials collected data on the casualties, leading to the confusion and the initial wrong toll.
The attack came at the end of more than a week of assaults that have left scores of Afghan troops and civilians dead.
Amnesty International on Thursday denounced the Kabul attack on the Shi'ites, calling it a war crime.
Afghan President Ashraf Ghani has also condemned the "terrorist" attack on the Shi'ites that "martyred and wounded the innocent" and ordered an investigation to determine how the bomber had managed to sneak into the compound, which has its own guards.