The gunfight started on Monday morning in Bahmnoo village between the Army and militants. State and central police forces later joined the operation that continued through the day.
Two militants were killed on Monday, while four soldiers were injured during the gunfight.
Two civilians had also sustained gunshot wounds as protesters engaged in clashes with the security forces by pelting stones at them to disrupt the anti-terror operation.
The body of the third militant was recovered on Tuesday after firing exchanges stopped in the area.
Although the police said exact identity of the slain militants was still being established, sources in the security forces said Kifayat Khandey and Jahangeer — two militants belonging to the breakaway Zakir Musa group of the Hizbul Mujahideen were among the slain militants.