Afghan forces killed two militants who had set off a car bomb and burst into the American University campus in Kabul on Wednesday evening, trapping hundreds of students and staff inside for several hours. The attack claimed lives of at least twelve people, according to police.

Seven students, three officers and two security guards were killed in the attack, according to chief of the Kabul police Criminal Investigation Department, Fraidoon Obaidi, quoted by Reuters. At least 44 people, including 35 students, were injured.

Afghan police: Attack on American University in Kabul ends after a three-hour battle, security forces kill 2 gunmenhttps://t.co/2hZ7mp1bEi — CCTVNEWS (@cctvnews) 25 августа 2016 г.

Early Thursday, Afghan police managed to kill the two attackers, ending the siege, Reuters reported.

“The fight is over and at least two attackers are killed,” a police representative at the scene told the agency.

Elite Afghan security forces reportedly stormed the building in the course of the operation, which ended just before dawn.

Police did not specify the details of the raid, stating that the clearance operation carried out by a criminal technique team is still underway.

“Many students jumped from the second floor, some broke their legs and some hurt their head trying to escape,” said Abdullah Fahimi, one of the students, who managed to escape the building.

About 500 students of the prestigious university, popular with the local elite, were rescued during the operation, Kabul police chief Abdul Rahman Rahimi said.

LATEST: American university in #Kabul is under attack by unknown gunmen pic.twitter.com/J88VSKyz20 — Mirwais Afghan (@Miirwais) August 24, 2016

The initial explosion - now assumed to be from a car rigged with explosives - was heard at about 7.30 pm local time.

“At the moment of the explosion, I was at the university – it was during class time,” Ali Altae, one of the students, told RT by phone from his home.

“They hit the front door, and through the hole that they made, they managed to get inside the campus. There were emergency exits, through which we managed to get out. But there are still people.”

Help we are stuck inside AUAF and shooting flollowed by Explo this maybe my last tweets — Massoud Hossaini (@Massoud151) August 24, 2016

“Help we are stuck inside,” tweeted Massoud Hossaini, an AP photographer. “These may be my last tweets.”

Hossaini, who injured his hands on glass from a shattered window, after being shot at by a gunman, later managed to escape.

#AUAF is targeted, some of buddies were escaped one of my ex- colleague has stuck on inside building. — Humayoonbabur (@Humayoonbabur) August 24, 2016

It appears that the attackers did not manage to get inside several of the key buildings, and were eventually forced into a next-door hospital for the blind.

#AF: " Don't kill me I'm very innocent " one my friend who stuck inside of Afghan American he is v educated guy just shortly return to AFG — Humayoonbabur (@Humayoonbabur) August 24, 2016

There is a heavy police presence around the district, which has been cordoned off, with armored vehicles and ambulances streaming in and out.

Afghan officials say US counter-terrorism advisers were on the scene, helping to resolve the standoff.

Several injured students were carried to the hospital and dozens of them still trapped inside #AUAF — 1TVNewsAF (@1TVNewsAF) August 24, 2016

The American University of Afghanistan was established in 2006 with the help of US funds and remains the country’s leading private university. All classes are taught in English, and there are currently over 2,000 students enrolled.

Earlier this month, two professors, an American and an Australian citizen, were kidnapped from its campus.

While no one has claimed responsibility, the Islamist Taliban group is the likeliest suspect. It has led a widespread insurgency since the mass departure of US forces in 2014, and is currently engaged in fighting government forces in about half of the country's provinces.

Reports of attack on American University in #Kabul. Exercise caution, avoid unnecessary movement in the area & monitor news for updates. — Travel - State Dept (@TravelGov) August 24, 2016