He said the fire was returned by the security personnel and in the ensuing encounter, two militants were killed.
Early, a policeman was injured in an attack in the same area of the district, a police official said.
The identities and group affiliations of the slain militants were being ascertained.
The forces surrounded Mir Mohalla village in Bandipora and Rangwar in Kupwara after receiving information about the presence of militants.
"At both these places, searches are going on".
The ultras shot at special police officer Ranbir Singh, who was posted on duty near deputy commissioner's office, a police office official said.
Security forces, deployed in strength, have sealed all exit points and started search operation, they said, adding that so far no one has been arrested.
Police had blamed Mehmood Bhai and his men for killing of off duty BSF constable Rameez Ahmad Parray at his home in Hajin area in September this year.
"Contrary to what is being projected in the media that south Kashmir is a hotbed of militancy, the figures reveal that north has more active militants". They caution him against acting as an "informer" of police and working for mainstream parties.