A 23-year-old student of Abdul Wali Khan University, Mardan was killed and another seriously injured by a vigilante mob for allegedly "publishing blasphemous content online", local police said Thursday.

The incident occurred within the university premises. The campus was shut down following the incident until further notice and its hostels vacated to avoid a further escalation of violence.

At least 45 people had been arrested in connection with the incident by Thursday evening, according to Mardan District Police Officer Dr Mian Saeed.

No case had been filed against the two students prior to the incident and police had not been investigating the two on blasphemy charges.

The mob instead seems to have been incited by rumours circulating among the university's student body.

WARNING: GRAPHIC CONTENT. An eyewitness's video of Mashal Khan's lynching.

Mardan's Deputy Inspector General (DIG) of Police Mohammad Alam Shinwari said the deceased student, Mashal, had been accused of running Facebook pages "which allegedly published blasphemous content".

He was attacked by a large group of students and appears to have succumbed to a gunshot wound, the DIG said.

“The charged students then wanted to burn his body,” Shinwari said, before police intervened.

'Beaten and bloody': eyewitnesses recount horror

An eyewitness at the scene of the incident said Mashal and Abdullah, two Mass Communication students, were attacked because they were believed to be "promoting the Ahmadi faith on Facebook".

Policeman inspect Mashal Khan's hostel room. —AFP

The eyewitness said a mob of university students first surrounded Abdullah and forced him to recite verses from the Holy Quran. Although he repeatedly denied the accusation that he was an Ahmadi, the students beat him nonetheless.

The police, when alerted, reached the site of the attack and rescued Abdullah, after which the mob set its sights on Mashal, who was in the hostel at the time, the eyewitness said.

Mashal was beaten and shot by the mob and succumbed to the injuries he received.

Video footage of the incident showed Mashal lying on the floor surrounded by men. The student was not moving and his body bore marks of severe torture. Men could be seen kicking his lifeless body and beating it with wooden planks.

Towards the end of the video, he was pulled from his clothes by an unidentified man.

Police inspect the hostel where students beat to death a classmate.—AFP

A student requesting anonymity said several leaders of the university's student bodies were part of the attacking mob.

One of Mashal's teachers later told Reuters that he was a passionate and critical student.

“He was brilliant and inquisitive, always complaining about the political system of the country, but I never heard him saying anything controversial against the religion,” the teacher said.

'Police unable to control the situation'

University administration official Fayaz Ali Shah confirmed that the mob of students had killed Mashal over allegations of 'blasphemy'.

He said over 20 officers had arrived at the scene, but were unable to control the situation because there were so many students involved.

Mob marching through campus premises. ─ DawnNews

Hostel warden Muhammad Ali, recounting the incident, claimed that: "Three to four thousand students were approaching. I was alerted that they were approaching, so I closed the gates but they broke in, found Mashal and fired at him and started beating him."

Students said police had been alerted of the incident and were present on campus at the time. When asked why they didn't intervene, police said there were "too many people" in the mob for them to take on.