Human rights groups say Pakistan's hardline blasphemy laws disproportionately target minority communities and encourage vigilante attacks
A man accused of blasphemy in Pakistan has been shot dead in a courtroom during his trial in the northern city of Peshawar.
He had been facing charges for allegedly claiming to be a prophet.
Blasphemy is legally punishable by death. No-one has been executed for it by the state but accusations can often lead to violent attacks, reports BBC News.
The victim, Tahir Ahmad Naseem, was accused of blasphemy in 2018 by a teenager.
He was killed at a trial hearing on Wednesday morning. Video shared on social media shows his body slumped over the court's seats.
His attacker was arrested at the scene. Another video shows him in handcuffs, shouting angrily that his victim was an "enemy of Islam."
Mr. Naseem was first accused of blasphemy by Awais Malik, a madrassa student from Peshawar. Mr. Naseem had struck up an online conversation with him whilst living in the United States.
Mr. Malik told the BBC he had then met Mr. Naseem in a shopping mall in Peshawar to discuss his views on religion, after which he filed a case against him with the police.
He said he had not been present at court, and had no knowledge of the shooting. The suspect arrested for the killing has been named as Khalid. It is not clear how he managed to bring a weapon into the court premises.
The victim was photographed shortly after he was shot dead
Mr. Naseem was born into the persecuted Ahmadi sect, according to a spokesman for the community. But he added that he had left the sect and claimed to be a prophet himself.
The community leader suggested Mr. Naseem had been mentally ill - he had uploaded videos to YouTube claiming to be a messiah.
Human rights groups say Pakistan's hardline blasphemy laws disproportionately target minority communities and encourage vigilante attacks. Dozens of people accused of being blasphemers have been killed by angry mobs or militants in recent years.
In an unrelated development, a hashtag campaign accusing a user of committing blasphemy has been trending on Twitter in the country.
But other users, concerned about the individual's safety, have been actively trying to drown out the accusations, using a separate hashtag -#btsarmypakistan - a reference to fans of the extremely popular Korean pop group BTS.
One of those involved in the counter-trend told the BBC it was an attempt to "resist right-wing trolls taking over the internet and possibly killing someone in the process."
Hashtags related to BTS were also used during recent Black Lives Matter protests in the US to drown out racist online counter-campaigns.