The encounter erupted after a joint team of police and army cordoned off Hari village in Tral in Pulwama and started a search operation following an intelligence input, police said.
As the search operation was going on, the militants, who were hiding in the area, tried to break the cordon and opened firing on the forces, superintendent of police, Awantipora, Irshad Ahmad, said.
He said two militants were killed in the encounter.
“They belonged to JeM and have been identified as Adil Pathan and Burmi," the SP said.
JeM has been responsible for several major attacks in Jammu and Kashmir and Delhi, including the one on Parliament on December 13, 2001.
The outfit was founded by Masood Azhar, one of the three terrorists released in exchange of passengers and crew of the hijacked Indian Airlines plane in December 1999.
With inputs from PTI.