At least five people died in an armed assault on a university in Pakistan Wednesday, where witnesses reported two large blasts and security forces said gunmen were still on the loose.

The attack on the Bacha Khan university in Charsadda, about 50 kilometres (30 miles) from the city of Peshawar, is the latest to hit the militant-infested region.

Police, soldiers and special forces launched a ground and air operation at the university in a bid to shut down the assault, as television images showed female students fleeing the campus.

"There are five dead bodies in front of me," said emergency official Bilal Faizi, speaking from the Bacha Khan university in Charsadda.

"All of them have bullet wounds," he told AFP.

READ: Gunmen attack university in NW Pakistan: school official

Military spokesman Major General Asim Bajwa said on Twitter that two attackers had been killed.

"Two more terrorists who were firing from inside the Block cordoned by Army troops, shot (and) killed. Op continues."

It was not immediately clear if the two were included in the toll of five given by emergency official Faizi.

Geology student Zahoor Ahmed said he had tried to leave his hostel after hearing shots fired.

"(We) were stopped by our chemistry lecturer who advised us to go inside. He was holding a pistol in his hand," he said.

"Then I saw a bullet hit him. I saw two militants were firing. I ran inside and then managed to flee by jumping over the back wall,"

Dozens of personnel in combat fatigues and automatic weapons piled out of transport vehicles as helicopters buzzed overhead and ambulances with sirens wailing approached the scene.

"There is firing inside the university at Charsadda," Saeed Wazir, a senior police official, told AFP, while Nasir Durrani, police chief of Khyber Pakhtunkhwa province -- of which Peshawar is the capital -- confirmed that the university has been cordoned off.

Officials at two hospitals in the city said a total of six injured people have been brought in from the university, four to the Lady Reading Hospital and two to a Charsadda district hospital.

"There are male and female staff members and students on the campus," Fazal Raheem Marwat, the university vice chancellor, said, adding he had been on his way to work when he was informed of the attack.

"There was no announced threat but we had already beefed up security at the university."

The gunmen had stormed the campus on its southern side, he said.

Naik Mohammed, security chief at the university, said the attackers had entered close to a campus guest house.

Peshawar was the location of Pakistan's deadliest ever extremist attack, when Taliban gunmen stormed an army-run school in December 2014, killing more than 150 people, most of them children, in an hours-long siege.


The attack on the school prompted a crackdown on extremism in Pakistan, with the military prosecuting an offensive against militants in the tribal areas where they had previously operated with impunity.

READ: Pakistan hangs four convicted of Taliban massacre at school

Pakistan's Jinnah Institute said in a report released Tuesday that the National Action Plan (NAP) helped curb extremist violence last year, although targeted attacks against religious minorities spiked in the nation of some 200 million people.

"The NAP has allowed improvements in two areas: the first actual implementation of prosecution against hate speech, and the arrest of terrorists from sectarian organisations which feed religious violence," said one of the authors, Syed Hassan Akbar.

On Tuesday, a suicide attack at a market on the city's outskirts killed 10 people in addition to the bomber.