There were no immediate reports of injuries, but Interior Ministry spokesman Tariq Arian said the gunfire was ongoing.
Afghan media reported a book exhibition was being held at the university and attended by a number of dignitaries at the time of the shooting.
University professor Zabiullah Haidari told a local TV station Ariana that classes were underway when the shooting began. University officials and security personnel were escorting students off campus, Haidari said.
Security forces blocked off roads leading to the campus as frantic families tried to reach their children at the university.
No group immediately took responsibility for the ongoing attack though the Taliban issued a statement saying they were not involved.
Violence has been relentless in Afghanistan even as the Taliban and a government-appointed negotiation team discuss a peace agreement to end more than four decades of war in the country. The talks in Qatar have been painfully slow and despite repeated demands for a reduction in violence, the chaos has continued unabated.
Last year, a bomb outside of the campus’ gates killed eight people. In 2016, gunmen attacked the American University in Kabul, killing 13.
Last month, the Islamic State group sent a suicide bomber into an education center in the capital’s Shiite dominated neighborhood of Dasht-e-Barchi, killing 24 students and injuring more than 100.