Armed militants stormed a university in volatile northwestern Pakistan, killing at least 20 people and wounding dozens, just over a year after the massacre of 134 students at a school in the area, officials say.
A spokesman for rescue workers, Bilal Ahmad Faizi, said 19 bodies had been recovered including students, guards, policemen and at least one teacher, named by media as chemistry professor Syed Hamid Husain.
The Daily Mail reports as militants executed targets one by one, Husain ordered pupils to stay inside as he confronted the attackers.
The father-of-two reportedly opened fire, giving them time to flee before he was cut down by gunfire as male and female students ran for their lives.
He was known to his pupils as 'The Protector', because he was a keen hunter and kept a pistol at school, possibly in light of previous militant attacks, The Daily Mail reports.
A senior Pakistani Taliban commander claimed responsibility for the assault in Khyber Pakhtunkhwa province, but an official spokesman later denied involvement, calling the attack "un-Islamic".
The violence nevertheless shows that militants retain the ability to launch attacks, despite a country-wide anti-terrorism crackdown and a military campaign against their strongholds along the lawless border with Afghanistan.
A security official said the death toll could rise to as high as 40 at Bacha Khan University in the city of Charsadda.
The army said it had concluded operations to clear the campus six hours after the attack began, and that four gunmen were dead.
Many of the dead were apparently shot in the head execution-style, TV footage showed.
The militants, using the cover of thick, wintry fog, scaled the walls of the university on Wednesday morning before entering buildings and opening fire on students and teachers in classrooms and hostels, police said.
Students told media they saw several young men wielding AK-47 guns storming the university housing where many students were sleeping.
"They came from behind and there was a big commotion," an unnamed male student told a news channel from a hospital bed in Charsadda's District Hospital.
"We were told by teachers to leave immediately. Some people hid in bathrooms."
Thirty five of the wounded remain in hospital, a local police official said late on Wednesday.
The gunmen attacked as the university prepared to host a poetry recital on Wednesday afternoon to commemorate the death anniversary of Khan Abdul Ghaffar Khan, a popular ethnic Pashtun independence activist after whom the university is named.
Vice Chancellor Fazal Rahim told reporters that the university teaches over 3,000 students and was hosting an additional 600 visitors for the poetry recital.
Umar Mansoor, a senior Pakistani Taliban commander involved in the December 2014 attack on the army school in Peshawar, claimed responsibility for the Charsadda assault and said it involved four of his men.
He told Reuters by telephone the university was targeted because it was a government institution that supported the army.
However, later in the day, official Taliban spokesman Muhammad Khorasani issued a written statement disassociating the militants from the attack, calling it un-Islamic.
"Youth who are studying in non-military institutions, we consider them as builders of the future nation and we consider their safety and protection our duty," the statement said.
The reason for the conflicting claims was not immediately clear.