The blast occurred at around 10:00 a.m. local time (5:30 GMT) inside a classroom at the Ghazni University in the city of the same name on Tuesday as a lecture was in session, university sources said.
Zahir Shah, the head of the provincial health directorate, said the explosion wounded at least 20 students — 15 young women and 5 young men — and that all the injured were being treated in the provincial hospital.
No group or individual has so far claimed responsibility for the blast.
The Taliban and Daesh groups are active in Afghanistan.
The United States and its allies invaded Afghanistan to remove a Taliban regime in 2001. Some 18 years on, Washington has been seeking truce with the militant group.
According to the United Nations, nearly 4,000 civilians were killed or wounded in militant attacks in the first half of the year.