At least eleven people were killed and several others injured after terrorists stormed the student hostel inside the Directorate of Agriculture Extension on University Road, Peshawar on Friday.
All the terrorists were killed by the security forces after launching an operation.
However, the death toll is expected to rise as a clearance and sweeping operation is now under way.
Geo News quoted the police official as saying that the attackers' first target was the security guard of the premises, following which they made their way inside towards the students' hostel.
"They could have wreaked havoc but the police and army successfully neutralised the threat," he added.
University Road, the major artery of the city, was closed down for traffic after the attack.
The injured were shifted to Khyber Teaching Hospital (KTH), located next to the directorate.
Pakistan Tehreek-e-Insaf (PTI) chairman Imran Khan condemned the terrorist attack in a tweet.
"Saddened by condemnable terrorist attack in Peshawar this morning. My prayers to the victims and their families.
Commend the rapid response of KP police and army that helped in containing damage and concluding the operation," Imran tweeted.
He also lauded the Khyber Pakhtunkhwa police for its timely action against the terrorists
"The reformed professional KP police force with its special rapid response unit has made a difference in dealing with acts of terrorism in a timely, holistic and coordinated manner," he said in a tweet.
Dawn quoted Khyber Pakhtunkhwa (K-P) Chief Minister Pervez Khattak as saying that although the KP police is "always alert, this incident happened suddenly".
"The police arrived and took control... Security measures have been taken keeping Eid Miladun Nabi in view. Our police was there soon after the firing started," he said.
(This story has not been edited by Business Standard staff and is auto-generated from a syndicated feed.)