ISLAMABAD, Pakistan — An antiterrorism court in Pakistan has sentenced a Shiite man to death for committing blasphemy in posts on social media. The man, Taimoor Raza, 30, was found guilty of making derogatory remarks about the Prophet Muhammad, his wives and others on Facebook and WhatsApp.

Mr. Raza was sentenced to death on Saturday by Judge Bashir Ahmed in Punjab Province. It was the first time anyone has been given the death penalty for blasphemy on social media in Pakistan. Mr. Raza can appeal the sentence.

Blasphemy remains a highly contentious issue in Pakistan, where mere allegations of the offense can lead to violence and killings by vigilante mobs. Critics contend that the country’s blasphemy law has been used to settle personal disputes and has worsened interfaith relations.

Counterterrorism officials arrested Mr. Raza at a bus station in Bahawalpur in April 2016. He was accused of having blasphemous content on his mobile phone, and officials said he had been showing the content to people at the bus station when he was arrested. Muhammad Shafique Qureshi, the prosecutor in the case, said that the court had found Mr. Raza guilty of blasphemy and that he had used Facebook and WhatsApp to spread the content.