Nineteen students have been killed by gunmen who stormed Kabul University before engaging security forces in an hours-long battle on Monday.
A spokesman for the Afghan interior ministry said the attack was eventually stopped when three gunmen were killed. A regional Islamic State group claimed responsibility in a statement.
The attack began shortly before the expected arrival of government officials for an Iranian book fair and continued for several hours.
All of the dead were students, including 10 women, a Kabul police spokesman told the AFP news agency. At least 22 people were wounded by the attackers.
The Taliban denied involvement and condemned the attack shortly after it began on Monday. Hours later the Islamic State group issued a message on the Telegram app saying it had targeted «the graduation of judges and investigators working for the apostate Afghan government».