The militants took up positions on Monday morning inside a 60-room institute in the region's main city of Srinagar, the second time this year rebels have used the compound as cover to attack soldiers. The building was empty at the time.
Soldiers pounded the government-run Entrepreneurship Development Institute with rocket grenades, flamethrowers and other weaponry before gaining access to it.
Major-General Ashok Narula said soldiers then searched the six-storey building room-by-room for the militants in a slow-moving operation that left one soldier injured.
Kashmir rights abuses ‘constitute war crimes’
"Two people have been eliminated and two weapons have also been recovered," Narula told reporters at the scene after the operation was declared over.
In February five soldiers, three militants and a civilian were killed during a gunbattle that also raged for three days in another building on the same compound. Rebels took refuge in the building after ambushing a paramilitary convoy.
Scores of villagers gathered this week near the compound shouting slogans in support of the militants and against Indian rule over the Himalayan territory.
Rebel groups have for decades fought Indian soldiers deployed in the territory, demanding independence for the region or its merger with Pakistan. Currently an estimated 500,000 troops are deployed there.
Kashmir has been divided between Pakistan and India since their independence from British rule in 1947. Both claim the territory in full.
No power on earth can stop Pakistan from supporting Kashmiris: PM reiterates
More than 90 civilians have been killed and thousands injured during the latest protests against Indian rule, sparked by the killing on July 8 of a popular rebel leader during a gunfight with soldiers.
Shops, schools and most banks have remained shut during the ongoing unrest, the deadliest since 2010.
Rebel attacks on government forces have also increased in recent weeks. On Saturday militants attacked a police post in the southern held Kashmir valley, killing one officer.
Militants raided an Indian army base in the region last month, killing 19 soldiers in the deadliest such attack for more than a decade. New Delhi blamed it on a Pakistan-based group.
COMMENTS
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ