The incident took place in the morning, when acting on information received, the police barricaded the highway to intercept some absconding criminals.
The police had received information that four robbers, after looting a petrol pump in Haryana, were headed towards Saharanpur, about 575 km from the state capital.
When the police barricaded their route, the robbers apprehended that they would be arrested and opened fire. The sudden volley of bullets hit constable Rahul, while the others scurried for cover.
A bullet narrowly missed a deputy superintendent of police (DySP).
Inspector General of Police (IG) Law and Order, R.K. Vishwakarma said the entire area had been sealed, and a major manhunt launched to nab the culprits.
The body of the slain cop has been sent for autopsy, and his family has been informed of the tragedy, the official said.