At least 22 people were killed by arms who stormed the University of Kabul prior to hour-long combat with security forces on Monday.
The attack was halted after the killing of three gunmen by an Afghan interior ministries spokesperson.
In a statement, a regional party of the Islamic State assumed responsibility.
The attack started just before the government officials were to arrive at a book fair in Iran and lasted for hours.
Twenty twenty-two more people were killed.
The government proclaimed Tuesday a national day of sadness.
The Taliban declined to take part and soon after it had begun on Monday condemned the attack. A few hours later, the Islamic State Party released the telegram message stating that it planned to “graduate judges and researchers working for the Apostate government in Afghanistan.”
In Afghanistan, IS has previously targeted education centers, and last month IS assaulted 24 people outside the school in Kabul. The group was also blamed for an attack in 2018 before the University of Kabul that killed hundreds.
President Ashraf Ghani said that the authorities will “take revenge for this senseless attack.” In a statement from the presidential palace.
Monday’s video footage on-campus shows students rushing away from the site in the distance with the sound of gunshots. In an attempt to avoid any scaled walls. According to an Interior Minister Speaker, one of the attackers exploded bombs at the outset of the assault.
The 23-year-old student Fraidoon Ahmadi was at the class when the gunfire began: “We were really terrified of it and felt it might be the last day of our lives. Boys and girls yelled, prayed, and called out for help.”
Fathullah Moradi, a witness, told Reuters that the gunmen “shoot every student they saw” and “shoot even those students who had fled”
Violence has escalated in Afghanistan over the last few months, even as the Taliban are holding peace talks in Doha, Katar. Preliminary matters have failed in the discussions after an earlier peace deal between the Taliban and the US in February.
A senior UN official told the BBC last week that, while Taliban officials informed the US that Al Qaeda would sever links with the Terrorist Group, it was still “heavily entrenched” in Taliban countries.
A car was struck separately on a street-side mine in Southern Helmand region, killing, according to Provincial Governor Omer Zwak, at least seven people, most of them women and children.