The clashes which erupted between the Afghan security forces and gunmen ended after six hours, he noted.
He confirmed the death of 19 people while another 22 injured, adding that 3 suicide attackers carried out the assault.
No group has claimed the responsibility for the attack.
Taliban, who has denied its involvement, condemned the attack, which inflicted casualties on university students and other civilian personnel.
“Senior Kabul administration officials, instead of feeling a sense of shame and remorse, are trying to somehow attribute responsibility to the Islamic Emirate, which itself shows that these attacks are a joint venture carried out to manufacture raw propaganda material,” said Zabihullah Mujahid, the spokesperson of Taliban.
“But all praise belongs to Allah, the Muslim Afghan nation knows the Islamic Emirate intimately and understands well that our Mujahideen never carry out attacks on educational institutes, public spaces or areas that have no military target,” he added.