Explosions and gunfire rocked the campus after the attack began Wednesday evening, 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 assault, but it occurred as the Taliban ramp up their nationwide summer offensive against the Western-backed government.
The presidential office said the attack was "orchestrated" from Pakistan, Afghanistan's longtime regional nemesis often accused of harbouring the Taliban.
The interior ministry said the fatalities included policemen, a university guard and a guard from the neighbouring vocational school for the visually impaired.
Also Read
Hundreds of trapped students were rescued during the overnight operation, many of whom tweeted desperate messages for help. Some used classroom furniture to barricade the doors while others made a mad scramble to escape through windows.
The attack began just after dusk, when the private university is usually packed with students, many of them working professionals doing part-time courses.
Authorities refused to confirm whether any hostages had been taken.
NATO military advisers helped Afghan forces to respond to the attack, a US official said, without specifying how many troops were involved.
At dawn, after the assault had ended, a few women students, some of them terrified and weeping, were escorted out of the campus by policemen.
The attack, apparently the first major militant assault on a prominent university in Afghanistan, has cast a pall on the education sector, seen as a rare symbol of hope for the country's burgeoning youth at a time of rising insecurity.
"Terrorist groups, by attacking civilians, educational institutions, residential areas, culverts, bridges, electricity stations... Want to obstruct growth and strengthening of the values that Afghans believe in," President Ashraf Ghani said in a statement, condemning the "brutal attack".
Disclaimer: No Business Standard Journalist was involved in creation of this content