Police in northwestern Pakistan said a man who allegedly said he was the "last prophet of Islam" was shot and killed in a courtroom where he was being tried under the country's blasphemy laws.
Witnesses and court officials said the defendant, Tahir Ahmad Naseem, was shot several times in front of the judge during a Wednesday hearing in Peshawar, capital of Khyber Pakhtunkhwa province.
The judicial proceedings against the slain man had been under way since 2018, when he was arrested for allegedly claiming to be the "last messenger of God," a violation under Pakistan's strict blasphemy laws that carried the death penalty, although no one has ever been executed by the state for the charge.
Police took into custody the suspected shooter, who said he took responsibility for killing the 47-year-old Naseem for having committed blasphemy.
Security is usually tight around the court during cases related to blasphemy offenses because it is an extremely sensitive issue in Pakistan.
It was not immediately known how the assailant managed to carry the weapons into the courtroom. Peshawar police chief Mohammad Ali Gandapur told reporters an investigation was under way.
Domestic and international human rights groups have long called for reforming Pakistan's blasphemy laws to prevent their misuse. They maintain blasphemy charges are often fabricated by influential people to intimidate religious minorities and settle personal feuds with rival Muslim groups.
Dozens of people are known to have been killed for allegedly committing blasphemy in Pakistan. Even mere accusations in certain instances have triggered mob lynchings of suspected blasphemers. The victims include doctors, teachers, lawyers and high-profile political figures.
In a landmark 2018 judgment, the country's Supreme Court acquitted a Christian woman, Asia Bibi, of blasphemy charges after she spent eight years on death row in a case that drew global attention.
Bibi has since secured asylum in Canada along with her family, to escape death threats from Islamists in Pakistan after her acquittal.