Five people have died in widespread violence over the demolition of an illegal madrasa in Uttarakhand's Haldwani.
The demolitions - carried out on Thursday with heavy police presence - aimed to clear government land allegedly encroached upon by the madrasa.
The demolitions complied with a court order, said Senior Superintendent of Police Prahlad Meena.
Officials said stones were pelted at them from rooftops - where they appeared to have been stocked - prompting the police to retaliate with tear gas.
The clash led to injuries to over 100 security personnel, with several administration officials, municipal workers, and journalists also caught in the crossfire.
The violence escalated as vehicles outside the police station were set on fire.
Police said about 50 people have been taken into custody for their alleged involvement in the violence, and a case registered against 5,000 unidentified people.
Uttarakhand police chief Abhinav Kumar said action will also be taken under the stringent National Security Act against those found to be involved in the attacks on police personnel.
On Friday and Saturday, no further incidents of violence were reported from Banbhoolpura where the madrasa - which included a "structure" where prayers were held - was demolished.
Curfew has been lifted from the outer areas of this violence-hit Uttarakhand town, but it remains in force in the Banbhoolpura area.
Over 1,000 police personnel remained deployed in the city, close to Nainital, officials said.
"Patrolling is continuously being done in the affected area and the situation is under control," Additional Director General (ADG) of Police, Law and Order, A P Anshuman, who is camping in Haldwani, was quoted as saying by news agency PTI.
Chief Minister Pushkar Singh Dhami visited Haldwani and met some of the injured. He termed the violence a "planned attack", and said arms, stones and petrol bombs were stockpiled by the rioters.
"Our women police personnel were brutally thrashed. They even tried to throw a journalist into the flames. It was an attempt to disrupt the atmosphere of social amity and peace for which Uttarakhand is known," Mr Dhami said.
High Court Stays Rs 2.42 Crore Notice Sent To Uttarakhand Violence Accused Key Accused In Uttarakhand Violence Arrested From Delhi Fresh Case Filed Against Haldwani Violence "Mastermind" Abdul Malik, Wife 150 mg Semen In Kolkata Doctor's Body, Suspect Gang-Rape: Parents To Court Independence Day Updates: "75,000 New Seats For Medical Students In Next 5 Years", Says PM Modi 2 French Rafale Jets Collide Mid-Air, Instructor, Pilot Missing "Strictest Punishment For Crimes Against Women": PM Amid Kolkata Protests "Working To Reduce Government Interference In People's Lives": PM Modi "Natural Disasters Increasing Concerns": PM Modi On Independence Day Track Latest News Live on NDTV.com and get news updates from India and around the world.