Photo used for illustrative purpose.
The man, a Muslim, was arrested on Wednesday in Quetta, the provincial capital of southwestern Balochistan province, after a video of him went viral and a case was filed against him.
A mob of around 200 young people later attacked the police station where he was being held, forcing the authorities to move him to another station.
"An on-duty policeman attacked him inside the lockup and shot him dead," the head of Balochistan police Moazzam Jah Ansari told AFP. "We have arrested him and registered a murder case against him," he said.
Muhammad Baloch, a senior local police official, also confirmed the details to AFP. The officer, who he did not name, had accessed a police station where a man accused of blasphemy was being held by pretending he was his relative before opening fire on him.
The man accused of blasphemy had been taken into custody earlier in the week and moved to a more heavily fortified station due to an enraged mob demanding that the police hand over a blasphemy suspect to them.
Blasphemy is punishable by death in Pakistan. No one has been executed by the state for it, but numerous accused have been lynched by outraged mobs.
Agencies