A standoff in the main market area of Srinagar, the capital of Indian-administered Kashmir, has ended after nearly 24 hours, with the death of two fighters at the hands of security forces.
Kuldeep Khuda, the police chief of Indian Kashmir, said on the Thursday that "the operation as far as we are concerned is over".
A small hotel taken over by the men was left in flames after the police operation.
The standoff began when the attackers threw grenades and opened fire in Srinagar's Lal Chowk, before forcing their way into the hotel on Wednesday.
The police entered the four-storey building on Thursday morning, and killed the first fighter.
"The other terrorist tried to set the building on fire ... the building caught fire and he tried to make his escape but he was shot down," Khuda said.
"We are trying to find out if any more terrorists were inside but there are two bodies that are visible."
Khuda claimed one of the fighters was a Pakistani national.
Responsibility claimed
Jamait-ul-Mujahideen, an armed group which wants Kashmir to be merged with Pakistan, has claimed responsibility for the attack and vowed to inflict heavy damage on Indian security forces.
"The attack is in response to India's propaganda that the armed struggle has weakened in Kashmir," it said.
The attackers had taken over the hotel after killing a policeman on Wednesday. A second man died of injuries in hospital and nine people were injured.
The hotel was surrounded by security forces, but no attempt was made to storm the building overnight, amid reports that some civilians were trapped inside.
There were sporadic exchanges of fire during the night.
Police said some 400 people had to be rescued from nearby buildings and the hotel.
Anti-Indian protests
Overnight, police fired teargas to disperse young Kashmiri men who threw stones at them, chanting "Kashmiri mujahideen, we are with you" and "we want freedom".
Mohammed Syed Malik, a journalist in Srinagar, told Al Jazeera the attack occurred in a psychologically significant area.
"This is the place ... where important political developments in the past have taken place ... and important public functions have taken place," he said.
"It is the commercial heart of Srinigar ... it is the political centre."
Armed Muslim groups have been fighting for independence from India or a merging with its neighbour Pakistan since 1989, with almost 70,000 people being killed during the conflict.
Kashmir is divided between India and Pakistan, who both claim sovereignty over all the territory.