"Both the policemen died at the spot. We don't know as yet who carried out the attack," city police chief Ashiq Bukhari told AFP.
The attack comes at a time when security is being stepped up in the region ahead of a visit by Prime Minister Manmohan Singh early next week.
Kashmir is divided between India and Pakistan along the UN-monitored Line of Control (LoC), but both countries claim the region in full and have fought two of their three wars over it.
Rebels opposed to Indian rule of the territory have been mounting shoot-and-run attacks on security personnel at regular intervals in recent times.
In April, armed militants attacked a police patrol near the northern Kashmir town of Sopore, killing four.