There were no casualties among the police officers, who fled the area as the residents approached the police station.
Al Jazeera's India correspondent, Prerna Suri, said that at least 35 protesters were injured in the explosion, which comes after three days of clashesin the Muslim-majority Kashmir valley.
"Many of the protesters were defying state imposed curfews and are demanding security personnel to be off their streets," our correspondent said.
Police said they had to open fire after tear gas and baton charges failed to disperse the protesters.
They opened fire with rifles when thousands of residents blocked a main highway and attacked security personnel.
"Many of the protesters were defying state imposed curfews and are demanding security personnel to be off their streets"
Prerna Suri, Al Jazeera's India correspondent
Residents said they were holding peaceful protests against Indian rule when security troops fired on them.
The shooting brought even more people out on to the streets, and witnesses said that they retaliated against the police with rocks and sticks.
They also set fire to at least three government buildings and two vehicles.
Our correspondent said that Ban Ki-moon, the UN secretary-general, issued a rare statement appealing for public calm.
She also said that Manmohan Singh, India's prime minister, held an emergency meeting with his cabinet colleagues on the issue of security in Kashmir.
India has blamed separatists for instigating the latest unrest but locals say the protests are spontaneous.
Decades of on-off political dialogue about the status of the disputed territory have yielded few rewards and no end to the deadlock. This has bred frustration among the residents.
The violence on Friday and Saturday was focused on the northern district of Baramulla, a traditional hotbed of Muslim separatism in the valley. It spread to south Kashmir on Sunday.
Police and witnesses said police and protesters clashed at over two dozens places across the valley.
Last week, the Kashmir state government ordered a judicial probe into the recent spateof police shootings.
The inquiry will be led by two retired judges and has been tasked with submitting a report within three months.