An ISIL suicide bomber killed at least 26 people in Kabul and injured dozens more on the road to a Shiite shrine, as Afghans celebrated the Persian new year on Wednesday.
It was the fifth major attack in the capital in recent weeks, with the attacker able to get within 200 metres of the shrine before he detonated his payload in a vast crowd.
There were distressing scenes at the hospital opposite the blast site where grief-stricken relatives screamed as they clutched and hugged the bloodied bodies of their loved ones, on what is normally a day of celebration for families.
The Persian new year, known as Nowruz, is a national holiday that marks the end of winter and the beginning of spring. Afghanistan’s minority Shiites typically celebrate by visiting shrines.
"They were mostly people celebrating Nowruz," Nasrat Rahimi, the deputy spokesman for Afghanistan's interior ministry, said of the victims.
The bomber struck near the Karte Sakhi shrine, with officials saying a heavy security presence meant he had not been able to reach the main building.
So he "detonated himself among teenagers returning from there," said Kabul police chief Mohammad Daud Amin, admitting that the attacker had managed to slip past earlier police checkpoints.
He said an investigation into the security breach is under way. Afghan security forces and the government have long been accused of incompetence and an inability to protect citizens.
Witnesses told police the bomb had been hidden inside a drum carried by the attacker, which detonated as onlookers got closer. Bloodied bodies could be seen among scattered belongings on the street.
President Ashraf Ghani in a statement condemned the attack, calling it a crime against humanity.
ISIL, which regularly targets Shiites in an attempt to stir up sectarian violence in Sunni-majority Afghanistan, claimed responsibility, announcing its involvement via their propaganda arm Amaq, monitoring group SITE intelligence said.
The insurgents had attacked the same shrine once before, in October 2016, when gunmen killed 18 people gathered to mark Ashura, an important date for many Muslims, especially Shiites.
There were fears that Wednesday's death toll could rise beyond 26, the figure quoted by the nation's interior ministry. The health ministry gave a higher toll of 29 people killed and 52 wounded. Afghan officials often give conflicting tolls in the initial hours that follow attacks.
But despite Wednesday's bomb and loss of lives in Kabul just hours later families including women and children came out on the streets with colourful clothes to continue to celebrate the New year holiday. Children flew kites and people are walking up the hills, shrines and other sides, eating and talking.
Both the Taliban and ISIL have increasingly targeted the war-weary city in recent months as US and Afghan forces ramp up air strikes and ground offensives against the groups. Wednesday's blast comes days after a Taliban suicide attacker blew up a bomb-laden car in Kabul, causing multiple casualties.
Some Western and Afghan security experts believe the Haqqani Network, a hard-line wing of the Taliban, has been behind some of the attacks in Kabul in recent months, including those claimed by ISIL.
The Taliban faces growing pressure to take up a recent offer by President Ghani of peace talks to end the 16-year war.
This latest suicide attack underscores the growing challenge facing Afghan and foreign forces to protect the already heavily militarised city.
General John Nicholson, who leads US and NATO forces in Afghanistan, recently told reporters that protecting Kabul was a priority for foreign troops.
"Kabul is our main effort right now, to harden Kabul, to protect the people of Kabul and the international community that are here because of the strategic impact that has and the importance to the campaign," General Nicholson said.
But he acknowledged that preventing further attacks would be challenging in the sprawling city that is poorly mapped and extremely porous.
The latest attack comes as US Chairman of Joint Chiefs of Staff General Joseph Dunford visits Afghanistan to assess the military campaign against insurgents - weeks before the start of the spring fighting season, which is expected to be particularly bloody this year.
Despite calls for the Taliban to sit down with the Afghan government, the group appears to have few reasons to negotiate.
The Taliban has been resurgent since the withdrawal of US-led NATO combat troops at the end of 2014, taking back territory and devastating Afghanistan's beleaguered security forces.
In October, insurgents controlled or influenced nearly half of Afghanistan's districts - double the percentage in 2015, the US government's office of the Special Inspector General for Afghanistan Reconstruction said in January.
Over the same period, the watchdog said, the number of districts under Afghan government control or influence fell to its lowest level since December 2015.