An attack at the American University in Kabul ended after two attackers were killed, police said early Thursday, nearly 10 hours after militants stormed the complex, prompting desperate pleas for help from trapped students.
The attack triggered explosions and gunfire, killing at least one person and wounding 26 others in an assault which comes just weeks after two university professors -- an American and an Australian -- were kidnapped at gunpoint near the school.
No group has so far claimed responsibility for the attack, but it comes as Taliban insurgents step up their summer fighting season against the Western-backed Kabul government.
"We have ended our clean-up operation. Two attackers were gunned down," Fraidoon Obaidi, chief of Kabul police's Criminal Investigation Department, told AFP without offering any details.
Local media reported that hundreds of students had been rescued during the overnight operation, many of whom tweeted desperate messages for help, with some using classroom furniture to barricade the doors.
Among them was Associated Press photojournalist Massoud Hossaini, who was said to be wounded and later managed to escape with some fellow students.
The attack started on Wednesday evening, when the private university is usually packed with students, many of them working professionals doing part-time courses.
"I heard explosions and gunfire is going on close by... our classroom is filled with smoke and dust," an anxious student told AFP by telephone, before managing to escape.
Authorities refused to confirm whether any hostages had been taken.
NATO military advisers were helping Afghan forces to respond to the attack, a US official said, without specifying how many troops were involved.
Many of the wounded were rushed into waiting ambulances outside the university on stretchers, as erratic gunshots rang out from inside the campus.
Obaidi declined to confirm details on casualties but the health ministry said late Wednesday that at least one person had been killed and 26 others wounded, many of them critically.
The American University of Afghanistan, which opened in 2006 and enrolls more than 1,700 students, is seen as a high-profile target for militants partly because it attracts foreign faculty members.
The two foreign professors at the university were seized from their vehicle on August 7, as the kidnappers smashed the passenger window and hauled them away at gunpoint.
It appeared to be the first reported abduction related to a private university in Afghanistan.
Their whereabouts are still unknown and no group so far has publicly claimed responsibility for the abductions, the latest in a series of kidnappings in the conflict-torn country.
The Afghan capital is infested with organised criminal gangs who stage kidnappings for ransom, often targeting foreigners and wealthy Afghans, and sometimes handing them over to insurgent groups.
The uptick in violence comes as the Taliban escalate nationwide attacks, underscoring the worsening security situation in Afghanistan.
Afghan forces backed by US troops are seeking to head off a potential Taliban takeover of Lashkar Gah, the capital of the southern opium-rich province of Helmand.
The turmoil convulsing Helmand, blighted by a huge opium harvest that helps fund the insurgency, has left thousands of people displaced, sparking a humanitarian crisis as officials report food and water shortages.
The Taliban have also closed in on Kunduz -- the northern city they briefly seized last year in their biggest military victory so far -- leaving Afghan forces stretched on multiple fronts.
But coalition forces have insisted that neither Kunduz nor Lashkar Gah are at risk of falling to the insurgents.