Students from Peshawar University protest to condemn the killing of Abdul Wali Khan university student Mashal Khan, after he was accused of blasphemy, during a protest in Peshawar, Pakistan April 19, 2017. Reuters/Khurram Parvez LAHORE, Pakistan (Reuters) - A Pakistani counter-terrorism court has sentenced to death a man who allegedly committed blasphemy on Facebook, a government prosecutor said on Sunday, the first time someone has been handed the death penalty for blaspheming on social media.

The conviction of Taimoor Raza, 30, follows a high-profile crackdown against blasphemy on social media by the government of Prime Minister Nawaz Sharif.

Blasphemy is a highly sensitive topic in Muslim-majority Pakistan, where insulting the Prophet Mohammad is a capital crime for which dozens are sitting on death row. Even mere accusations are enough to spark mass uproar and mob justice.

Shafiq Qureshi, public prosecutor in Bahawalpur, about 500km (300 miles) south of provincial capital Lahore, said Raza was convicted for allegedly making derogatory remarks against Prophet Mohammad, his wives and companions.

"An anti terrorism court of Bahawalpur has awarded him the death sentence," Qureshi told Reuters." It is the first ever death sentence in a case that involves social media."

It is rare for a counter-terrorism court to hear blasphemy cases but Raza's trial fell under this category because his charge sheet included counter-terrorism offenses linked to hate speech.

Qureshi said Raza was arrested after playing blasphemous and hate speech material on his phone on a bus stop in Bahawalpur, where a counter-terrorism officer arrested him and confiscated his phone. The material obtained from the phone led to Raza's conviction, he added.

"The trial was conducted in Bahawapur jail in tight security," Qureshi said

Qureshi added that Raza belongs to the minority Shia community and in court he accused of spreading "hate speech" against the Deobani sect, which adheres to a strict school of Sunni Islam.

Relations between Shia and majority Sunni communities have flared up at times in Pakistan, with some extremist Sunni groups such as Lashkhar-e-Janghvi trying to exploit sectarian tensions.

Several other violent incidents linked to blasphemy accusations have alarmed human rights groups and activists in recent months.

Police are currently investigating over 20 students and some faculty members in connection with the killing of Mashal Khan, a student who was beaten to death on April following a dorm debate about religion -- an attack that shocked the country.

Since then, parliament has discussed adding safeguards to the blasphemy laws, a move seen as groundbreaking in Pakistan where political leaders have been assassinated for even discussing changes.

As Raza's blasphemy conviction was under the counter-terrorism court, he will be able to appeal his sentence in the High Court and later in the Supreme Court.

There have been at least 67 murders over unproven allegations since 1990, according to figures from a research center and independent records kept by Reuters.

(Writing by Drazen Jorgic)