A cavalcade of senior superintendents of police of Pulwama and Awantipora Raees Ahmed and Zahid Malik was going along with the district's Additional Superintendent of Police Chandan Kohli.
"The militants, travelling in a vehicle, were challenged at a 'naka' (checkpost) set up by security forces in Padgampora area of Pulwama, but instead of giving themselves up, started firing at the security personnel triggering a brief gunfight in which both were killed," a police officer said in Srinagar.
The police have seized two weapons and the identity of the terrorists killed is being ascertained, Deputy Inspector General of Police (South Kashmir) S Pani told news agency Press Trust of India.
He lauded the role of the police force which swiftly neutralised the two terrorists.
Last night, terrorists carried out two attacks on police forces, pushing the state on high alert days ahead of Prime Minister Narendra Modi's visit and the upcoming parliamentary by-elections in Jammu and Kashmir.
According to the police, the terrorists said they wanted to kill the officer who is currently posted at the Baramulla district jail, where terrorist-turned separatist leader Masarat Alam is lodged.
Prime Minister Modi is expected to visit Jammu and Kashmir on April 2 for the inauguration of Chenani-Nashri tunnel.