Rashtriya Rifles troops shot dead two militants in Drugmulla village in Kupwara district of Jammu and Kashmir on Tuesday morning.
They were part of a suicide squad that wanted to storm the sector headquarters of 7 Rashtriya Rifles, according to police sources in Srinagar.
However, soldiers on the entrance of the facility saw the militants coming and opened fire.
Other members of the squad escaped, the police said.