A spokeswomen for two hospitals in the city said they had received a total of nine bodies and were treating some 38 injured, including several in critical condition.
IG KPK Mehsud had earlier confirmed that at least four persons were injured including two students in the attack.
Authorities said the gunmen had been killed and security forces had cleared the area after searching for remaining militants.
The KP police said that all terrorists were neutralised after a successful clearance operation by the security forces.
The area where the incident occurred is a hub for educational institutions including the University of Peshawar.
Taliban claimed the responsibility, saying in a message from spokesman Mohammad Khorasani that they had targeted a safe house of the military's Inter-Services Intelligence agency.
Volunteers carry an injured student after an attack by Taliban gunmen in the city of Peshawar.
Pakistan media Geo news reported that three attackers, with their faces covered, entered the Directorate, located next to the University of Agriculture, and started firing. The university hostel usually houses almost 400 students, but most had gone home for a long holiday weekend and only about 120 students remained.
Soldiers stand guard after an attack by Taliban militants in Peshawar. Moreover, the operation was monitored through aerial surveillance conducted by the army aviation division in addition to armoured vehicles that were present on the site of the operation. "We took them out with us and admitted them to the hospital", said Ariful Haq, adding that around 120 students live in the hostel but most had gone home due to the long weekend. They are loosely allied with the Afghan Taliban insurgents who ruled most of Afghanistan until they were overthrown by US-backed military action in 2001.