The incident took place when security forces launched a search operation in Parraypora village after receiving information about holed-up militants.
Eight people, including seven security men and one civilian, were injured during the gunfight in the village located in Hajin area.
The gunfight has ended, police said.
The slain militants identity is being established.
The three soldiers killed in the gunfight belonged to the counter insurgence 13 Rashtriya Rifles.
The injured security men, including a Commanding Officer of the paramilitary Central Reserve Police Force (CRPF), six other security personnel and a civilian have been shifted to a hospital for treatment.