A journalist and a university security guard are said to be among the injured.
Police and army troops summoned to the scene killed all of the attackers at the Agriculture Training Institute in the northwestern city of Peshawar about two hours into the attack, the military's press wing said.
Another government-run hospital, the Kyber Medical Complex, said it had received three dead bodies and was treating 20 injured people.
The attackers were wearing a full-face burqa (veil) and came in a rickshaw, said IG Khyber Pakhtonkhwa Salahuddin Mehsud while speaking to ARY News.
Hospital authorities said nine persons mostly students were killed in the attack. "I got up and within seconds everybody was running and shouting 'the Taliban have attacked, '" said a student.
Sees first flu death of the season
Because flu viruses are always changing-it's important to get the flu vaccine as soon as possible. "Even though we're all using the same flu vaccine , we haven't seen it here in the USA yet".
The Dawn quoted police officials, as saying that the terrorists aimed to attack the university hostel.
Noor Wali, a 19-year-old student at the institute, described a terrifying ordeal that began when he was woken by gunshots.
Wali and another student rushed to his aid, hiding from the gunmen for nearly an hour before they were rescued by security forces.
An interior ministry official told AFP that cellular networks had been suspended in various cities across the country for security reasons.
Tehreek-e-Taliban Pakistan (TTP) claimed responsibility for the attack.
Tampa Police Makes Arrest in Serial Killer Case
That resulted in his manager notifying an officer who was inside the restaurant, and Donaldson was subsequently arrested. He started there February 13 and worked for about three months before he was sacked for absenteeism.
The incident comes amid tight security across Pakistan as it celebrates the birthday of the Prophet Mohammed.
In December 2014, Pakistani Taliban gunmen killed 134 children at Peshawar's Army Public School, one of the single deadliest attacks in the country's history.
Peshawar Capital City Police Officer Tahir Khan and SSP operations were reported to have led the operation which has now been completed.
The protests finally ended just days ago under a military-brokered deal.
Ole Miss supposed to get NCAA ruling on infractions Friday
Ole Miss had self-imposed both a bowl ban for this season and scholarship restrictions, but the NCAA added more to each element. Freeze resigned over off-field issues - including allegations that he repeatedly made phone calls to escort services - in July.