BEIJING - After a fresh outbreak of violence between Hong Kong police and pro-democracy demonstrators, a Hong Kong court granted an injunction Monday that could set in motion a bid by authorities to clear parts of the main protest site.

The court action spelled out some limits, such as requiring security forces to give prior notice before moving against the protest encampment. But it reflects expanding efforts by officials to sweep away visible signs of the most serious challenge to Beijing's control since it took over the former British colony.

But the protests, which began more than two months ago over election rules imposed by Beijing, have shown resilience despite the steady crackdowns and pressures.

The latest backlash came as thousands of pro-democracy activists tried to surround government headquarters. Riot police, armed with pepper spray, batons and water hoses, moved in to disperse the demonstrators.

At least 40 protesters were injured and 40 were arrested, according to authorities. Volunteer medics attended to the numerous injured among the protesters, many wearing protective goggles and body armor.

Police added that 17 officers were injured in the overnight clashes.

By Monday evening, the activists' failed attempt to occupy new ground caused dissension at the main protest site, with some accusing student leaders of lacking a firm plan before trying to expand their occupation.

Student leader Alex Chow apologized to his fellow demonstrators, acknowledging that protest leaders should have been better prepared. But he blamed the injuries and violence on police, insisting that the protesters had remained peaceful.

Now, the next steps on both sides are unclear.

Chow and other student leaders said they wanted to consult others in the pro-democracy movement before their next steps.

Meanwhile, three protesters, including student leader Joshua Wong, announced that they were beginning a hunger strike intended to last until the government resumes a dialogue with demonstrators about their demands.

Hong Kong's embattled chief executive, Leung Chun-ying, told reporters Monday that police had so far been tolerant but would now "enforce the law without hesitation" to end the protests, which have paralyzed parts of the Asian financial hub.

He called the protesters' actions "not only illegal" but also "in vain."

"Some people have mistaken the police's tolerance for weakness," Leung said. "I call for students who are planning to return to the occupation sites tonight not to do so." He did not respond to a question about whether police would move in soon.

The court injunction covers some parts of the main protest site in the Admiralty area.

The protesters are calling for free elections in 2017 for Hong Kong's next chief executive, rather than a choice among Beijing's pre-screened candidates.