A police officer was lynched in Srinagar, Jammu and Kashmir, early on Friday after he allegedly opened fire on a group of people that had caught him taking photographs near a mosque. The police said the mob attacked Deputy Superintendent of Police (Security) Mohammad Ayub Pandith after spotting him behaving suspiciously outside Jamia Masjid in Nowhatta locality during congregational prayers at the mosque, NDTV reported.

Director General of Jammu and Kashmir Police SP Vaid said two people had been arrested and a third had been identified. “They will have to face the law,” he told reporters. “People should understand the difference between good and bad. They killed someone who was on duty to protect them.”

Witnesses to the violence said three people were injured after Pandith allegedly began to shoot at them with his pistol as the mob tried to catch him. They are believed to have stripped him naked before beating and stoning him to death.

At the officer’s wreath laying ceremony, Jammu and Kashmir Chief Minister Mehbooba Mufti called it an “extremely shameful incident”. The police said, “Another police officer sacrificed his life in line of duty.”

The DSP’s service revolver is missing, and since he was not in uniform when he died, he was identified only hours later when his family called his mobile phone. Responding to reports that Pandith was killed after he opened fire, the police said he had the right to fire in self defence.

The violence came ahead of a call for protests from Kashmiri separatist leaders against a civilian’s death in clashes in Pulwama on Thursday. Local residents had clashed with security forces after three suspected Lashkar-e-Taiba militants were killed in an encounter.

As a precaution before the expected protests, restrictions had been ordered in areas under the jurisdictions of seven police stations from Friday morning. After lynching the officer, the frenzied mob had targeted empty security pickets set up in the area.