Nov. 2 (UPI) -- A militant attack that lasted for hours at a university in Afghanistan's capital on Monday has killed nearly two dozen people, authorities said.
The attack at Kabul University killed at least 22 people and injured almost two dozen.
The government has declared Tuesday a national day of mourning.
Afghanistan President Ashraf Ghani said authorities would "take revenge for this senseless attack" in a statement issued by the presidential palace.
Witnesses said militants entered classrooms at the school's law faculty training center and opened fire on students and instructors. They held more than 20 students and professors hostage during the siege.
The school was hosting a book event at the time of the assault, which included senior Afghanistan officials.
Authorities ultimately killed three militants at the university, one of Afghanistan's largest, to end the standoff.
A regional Islamic State group claimed responsibility for the attack in a statement.
The Islamic State group said on a message on the Telegram app that it had targeted "the graduation of judges and investigators working for the apostate Afghan government."
COVID-19 restrictions have been eased at the university in recent weeks and students have only recently returned to classes and dormitories.
An affiliate of the Islamic State has fought Afghan and U.S. forces in the country for the past three years. Officials say some fighters have emerged in larger cities like Kabul and have been part of attacks that often resemble those of the Taliban.
The Taliban, which is currently involved in peace talks with the U.S.-backed Afghan government, said it was not involved in Monday's attack.
Monday's was the second attack at an educational center in Kabul in the past few weeks. A suicide bomber killed dozens of people at a tutoring center on Oct. 24.