The victim had been escorted into court by police in the northern city of Peshawar when a man opened fire with a pistol.
A man accused of blasphemy in Pakistan has been shot and killed during a court hearing in the country's northwest, according to police and local media.
It was not immediately clear how the assailant, identified as Khalid Khan, managed to get into the court amid tight security. The attacker was subsequently arrested.
The man on trial, Tahir Shamim Ahmad, had claimed he was a prophet and was arrested two years ago on blasphemy charges, according to Azmat Khan, the police officer. Ahmad died before he could be transported to a hospital.
The deceased was a former member of Ahmadiyya sect and was a US citizen.
Nasim was first arrested in April 2018 after a local accused him of blasphemy, a highly inflammatory charge in deeply conservative Pakistan that has sparked mob lynchings, murders and mass protests.
The shooting took place on the premises of a judicial compound in Peshawar near the Afghanistan border, where the plaintiff opened fire on the accused during the blasphemy trial hearing.
In a tragic incident today a man was shot dead in front of a judge in Peshawar. It is being reported that he was Ahmadi, which is not true. He was born Ahmadi but left the community many years ago. /1— Saleem ud Din (@SaleemudDinAA) July 29, 2020
Police Chief Mohammad Ali Gandapur told reporters the shooter, a Facebook friend of the deceased, was arrested.
In a tweet, Jamaat-i-Ahmadiyya Pakistan spokesperson Saleemuddin confirmed the deceased was born into the sect but abandoned it years ago.
Death penalty offence
Blasphemy is a criminal offence in Pakistan that can carry the death penalty. While the state has never executed anyone under such laws, mere allegations have stirred mass protests and violence.
Rights groups argue that blasphemy laws are often exploited to settle personal scores against religious minorities and should be annulled.
Supporters, however, believe the absence of such laws would foment religious violence.
There are nearly 600 cases of blasphemy pending in the courts, two-thirds of which involve Muslims, according to local media.
A Punjab governor was killed by his own guard in 2011 after he defended a Christian woman, Asia Bibi, who was accused of blasphemy.
She was acquitted after spending eight years on death row in a case that drew international media attention. Faced with death threats upon her release, she flew to Canada to join her daughters last year.