Several gunmen have attacked Bacha Khan University in volatile northwest Pakistan, killing over 20 people and injuring dozens of others. The attack is reminiscent of the deadly raid on a Peshawar school just over a year ago.

The attack started Wednesday morning as students and staff were gathering for classes. The death toll of the violence is still being updated, but according to local police has now risen to 21 people.

The final number of dead may rise as high as 40, a Pakistani security official told Reuters. The bodies of students, guards, police officers and a teacher, identified by the media as chemistry professor Syed Hamid Husain, were recovered by rescue workers.

Army troops cordoned off the campus after reports of the gunmen came in. They also held back relatives of the students, who had gathered outside. A military helicopter circled over the area while the military operation was underway.

The attackers scaled the walls of the university using the cover of fog and went on a rampage, indiscriminately killing people, survivors of the attack said. Some of the victims were shot in the head, TV footage of the carnage showed.

Update:Snipers killed 2 more terrorists on roof top,total Terrorist killed so far 4.All buildings&roof top taken over by Army.op continues-3 — AsimBajwa (@AsimBajwaISPR) January 20, 2016

Bacha Khan Univ incident-wards vacated for injured in DHQH Charsadda #KP — Information & PRs KP (@infokpgovt) January 20, 2016

The operation to round-up and kill the four gunmen took six hours, the army reported.

Prof Syed Hamid Husain, a PhD in Organic Chemistry has been Martyred in the ongoing attack on Bacha Khan University pic.twitter.com/yi9gslBXWG — Army Defender (@ArmyDefender) January 20, 2016

A cop injured in #BachaKhanUniversity attack is being treated at LRH #Peshawarpic.twitter.com/DuU7MG608u — Javed Aziz Khan (@JavedAzizKhan) January 20, 2016

Bacha Khan University is located in the suburbs of Charsadda, a district capital city in Khyber Pakhtunkhwa province in the turbulent northwest of Pakistan. The province has seen regular clashes between the Pakistani Army and fighters of the Pakistani Taliban militant movement.

The university has around 3,000 students, Vice Chancellor Fazal Raheem told the media. The attack happened as the university was hosting a poetry event attended by around 600 guests. The event was meant to commemorate the death of Khan Abdul Ghaffar Khan, the Pashtun peace activist and spiritual leader, after whom the institution was named.

There was a poetry competition that was to be held today within the University premises in Charsadda. An additional 600 gueats were invited. — Iftikhar Firdous (@IftikharFirdous) January 20, 2016

Pakistan Army's QRF and KPK Elite force arrive on the spot to carryout an operation at #BachaKhanUniversity #Charsadda Опубликовано Bacha Khan University Charsadda (OFFICIAL) 19 января 2016 г.

READ MORE: 7 killed in gun battle after terrorists storm Indian airbase near Pakistani border



Umar Mansoor, a senior Pakistani Taliban commander claimed responsibility for the assault. He told Reuters that the four gunmen killed by Pakistani troops were his men, and said the university was targeted because of its support for the government and the army.

A conflicting statement by Pakistani Taliban spokesman Muhammad Khorasani denied the organization’s involvement, indicating a possible schism among the militants.

READ MORE: 141 people, mostly students killed by Taliban in Pakistan army school seizure

In December 2014, Peshawar, in Khyber Pakhtunkhwa, was the site of one of the deadliest terrorist attacks seen in Pakistan. In that incident, a group of Taliban insurgents raided a school for children of military officers, killing 148 people, most of them children.

The Peshawar school attack triggered a strong response from the Pakistani government, which has launched a large-scale military crackdown on the militants. Prime Minister Nawaz Sharif reiterated the resolve to fight terrorism in a statement released after the massacre.