A group of youngsters tried to drag him away and he opened fire at them with a pistol, injuring three in the lower limbs. Subsequently, he was beaten to death.
The police have identified the person killed outside the Jamia Masjid in Srinagar as a deputy superintendent of police.
"Another police officer sacrificed his life in line of duty. DySP Mohammed Ayub Pandith was attacked and beaten to death by a mob at Nowhatta on Thursday night," said a police spokesman.
The incident happened during the Shab-e-Qadr, night-long prayers held in Ramzan time, as Hurriyat chairman Mirwaiz Umar Farooq was inside the mosque. Three locals were injured in a shootout.
Eyewitnesses told The Hindu that a group of youngsters, on spotting the policeman making a video of a demonstration outside the Jamia Masjid between 11:30 p.m. and 12:00 a.m., tried to drag him away and he opened fire at them with a pistol, injuring three in the lower limbs. As rumour spread that he belonged to some "security agencies and was a non-Muslim," a mob lynched him.
A police official said policemen fired in the air to chase away the mob and retrieve the officer's body and a clash ensued. No personnel in civvies was present at the spot and "all policemen were safe", the police said.
The Jamia Masjid area is known for throwing of stones and clashes on occasions like Shab-e-Qadr. The incident assumes significance as the Mirwaiz was inside the mosque and delivering his sermon.
The incident did not impact the obligatory prayers and other ceremonies held inside the mosque. Tear-smoke shells and firing, however, spread panic in the area. The incident was followed by pro-Pakistan and pro-militant slogans in the area.
Meanwhile, the authorities have decided to impose curfew like restrictions under Section 144 in seven police stations in Srinagar to contain the situation emerging after the civilian and militant killings on Thursday in south Kashmir and the latest incident.
No Friday prayers will be allowed at the mosque in the wake of the restrictions. The Mirwaiz was planning to address a major congregation at the mosque on the occasion of the last Friday of Ramzan.
Kashmir remains on the edge from Thursday morning since the killing of three Lashkar-e-Taiba militants in an encounter.