The terrorists were inside the mosque and security forces, as well as a host of anxious locals, outside. The situation in Kashmir's Shopian town was volatile and the challenge was to flush out the five men while protecting the place of worship but it was 'mission accomplished', officials said on Saturday. Enabling the successful effort, which culminated in what was the first time in more than 20 years that five terrorists were gunned down in the restive south Kashmir town, were the parents of the terrorists and prominent citizens of the area, the officials said, counting up to 17 appeals made to them to surrender peacefully.

As the tension built up over the hours between Thursday night and Friday afternoon, the loudspeaker rang out intermittently with appeals from the parents of the terrorists holed up inside the Jama Masjid, citizens and Army personnel. Groups of people were also sent inside to negotiate with the men to come out peacefully, officials recounted.

That didn't happen. Finally, on Friday afternoon, the last of the five men of the banned Ansar Ghazwatul Hind (AGuH), a shadow group of the Jaish-e-Mohammed, were gunned down and with minimal damage to the mosque. Narrating the events of the day, officials said the forces of the 44 Rashtriya Rifles and Jammu and Kashmir Police were undeterred by the terrorists refusal to surrender and moved closer to the mosque.

Against the established practice of maintaining safe distance from the target area, Army officers took the decision to move towards the mosque. The intention was to engage in pinpoint and not random, distant firing.

"Our main concern was to preserve the sanctity of the masjid while neutralising the terrorists. This exposed our troops to high degree of risk while engaging with the terrorists, who were heavily armed," says Maj Gen Rashim Bali, General officer in Command of Victor Force that looks after militancy in South and central Kashmir. He said the message had to be firm that "picking up weapons against the state is not an option and would be suitably responded to". The operation against the men started in the dead of night at 1 am on the intervening night of Thursday and Friday following an intelligence tip-off that five terrorists were hiding inside the mosque. Within no time, the area was sealed and many civilians evacuated to safer places, officials said.

While three of the terrorists were killed by dawn, the other two were gunned down at 2 pm on Friday. The Army had deployed drones to keep a close watch on the movements of the terrorists.

Officials said the parents of one of the terrorists, the brother of another and a prominent citizen were sent inside the mosque to ask them to give up arms but to no avail. At one point, a terrorist fired at a citizen who asked them to surrender in order to ensure the mosque is not damaged. The terrorists, officials said, also attempted to set ablaze a portion of the mosque in their attempt to flee.

After the operation, the troops cleared and cleaned the mosque and handed over all the religious books to the local administration to stem rumours about some books being desecrated.

This was the first time that terrorists were cornered inside the mosque in Shopian town. The last big encounter in Shopian was in the late 1990s when four terrorists were killed.