A suicide bomber on Wednesday killed at least 26 people, many of them teenagers, after detonating a device among a crowd of people in Kabul who were celebrating the Persian new year holiday, officials said.
The Islamic State group claimed responsibility for the deadly attack -- the fifth suicide bombing in the Afghan capital in recent weeks -- via its propaganda arm Amaq, SITE Intelligence Group said.
The Taliban earlier denied involvement on Twitter.
Another 18 people were wounded in the blast, interior ministry spokesman Nasrat Rahimi said, "all of them civilians".
There were fears the figure could rise, however, with the health ministry giving a higher toll of 29 people killed and 52 wounded. Afghan officials often give conflicting tolls in the wake of attacks.
The bomber, who was on foot, detonated his device in front of Kabul University and a hospital that was opposite, Rahimi said.
The blast occurred less than 200 metres from Karte Sakhi shrine where many Afghans gather every year to mark Nawrooz, which is the traditional Persian new year holiday -- but had been unable to reach it due to heavy security for the holiday.
He "detonated himself among teenagers returning from there", Kabul police chief Mohammad Daud Amin told Tolo News.
Bloodstains could be seen among scattered belongings on the road at the site of the attack. A man who was standing metres from where the explosion happened told Tolo that he saw "at least four bodies in blood" on the ground.
IS has 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.
President Ashraf Ghani, whose government has been repeatedly lambasted for its inability to protect its citizens, condemned the attack in a statement as a "crime against humanity".
Taliban and Islamic State militants 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 IS group.
The Taliban, Afghanistan's largest militant group, faces growing pressure to take up a recent offer by Afghan President Ashraf Ghani of peace talks to end the 16-year war. So far it has given only a muted response.
This latest suicide attack underscores the growing challenge facing Afghan and foreign forces to protect the already heavily militarised city.
Authorities had increased security ahead of Nawrooz festivities, which militants have previously struck with deadly force.
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," 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.