The gunfight took place in Dooru (Dangerpora) village near Sopore town, 60 km from here, Inspector General of Police Abdul Ghani Mir told IANS.
The dead reportedly belonged to the Jaish-e-Muhammad (JeM) outfit.
A defence ministry spokesman told IANS that two Rashtriya Rifles soldiers sustained minor injuries in the fight. Three AK-47 rifles were recovered from the slain militants.
“Security forces including police, Rashtriya Rifles and Central Reserve Police Force carried out a joint operation against the militants based on intelligence inputs in Dooru village,” the police chief said.
When the militants in hiding were challenged, they opened indiscriminate fire at security forces, resulting in a gunfight that ended Monday evening, he said.
“Three militants, all of them foreigners, were killed. The operation has ended although a search is still on,” the police official said.
Tension gripped the village and Sopore town as news of the gunfight spread.
Last week, an assistant sub-inspector of police was killed and three other policemen were injured in Chankhan in Sopore.