PESHAWAR: In a heroic act, a Pakistani chemistry professor in his 30s lost his life on Wednesday while trying to protect his students using his licensed pistol against armed Taliban militants who stormed the university, The Indian Express reported.

Assistant prof. Syed Hamid Hussain, 34, fought back against the terrorists as he warned students not to leave the building of the Bacha Khan university in Charsadda, some 50 kms southwest of Peshawar.

Students spoke of the hero teacher, who flashed his pistol but was gunned down by the militants, media reports said.

“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.” Another student told reporters he was in class when he heard gunshots.

“We saw three terrorists shouting slogans and rushing towards the stairs of our department,” he said as he described seeing the chemistry professor holding a pistol and firing at the attackers.

“Then we saw him fall down and as the terrorists entered the registrar office we ran away,” said the student. President Mamnoon Hussain confirmed Hamid was among the deceased and condoled his death.

Netizens took to social networking sites to hail the lecturer as a “martyr”.

The official Facebook page of the university also said Hamid was among those killed. Teachers in northwest Pakistan were given permission to carry firearms in the classroom after the Peshawar school carnage of December 2014 in which Taliban militants killed over 150 people, mostly children.