Deputy Commissioner Tahir Zafar says the attack began shortly after the Bacha Khan University opened for classes on Wednesday in Charsadda town, some 35 kilometers (21 miles) outside the city of Peshawar.
Heavy police and military forces were deployed to the area, and a gunbattle is underway. Hospital official Sher Akbar Khan says the hospital has received 19 bodies so far.
Pakistani army says the attackers have been contained and that four of them have been killed.
PM Shah holding meeting with vice chancellors of universities,...
No one has claimed responsibility for the attack.
A Taliban attack on a school in Peshawar in December 2014 killed over 150 people, mostly children.