A suicide bomber killed 31 people in an explosion near Kabul university as people gathered to celebrate a New Year festival.
Wahid Majro, spokesman for The Public Health Ministry, said 65 people were wounded in the attack, which was carried out by a bomber on foot.
The blast happened on the road toward the Sakhi shrine where people gather to celebrate the Persian New Year festival, a spokesman for the Kabul police chief said.
Islamic State claimed responsibility for the attack in an online statement, according to the SITE Intelligence Group, which monitors jihadi websites.
The group said the attack targeted "a gathering of Shiites celebrating Nowruz."
Nauruz, the Persian new year, is a national holiday and the country's minority Shiites typically celebrate it by visiting shrines.
Afghanistan is home to a powerful Islamic State affiliate that has repeatedly targeted Shiites, who the extremists view as apostates deserving of death.
General Daud Amin, Kabul's police chief, said the attacker managed to slip past police checkpoints set up along the road.
He said that an investigation into the security breach is underway.
Afghan President Ashraf Ghani in a statement condemned the attack, calling it a "crime against humanity."
Earlier this month, another IS suicide bomber targeted Afghanistan's ethnic Hazaras, killing nine people and wounded 18 others.