Thousands of people turned out in heavy rain across Hong Kong on Sunday to denounce a ban on face masks, brought in under sweeping colonial-era emergency powers in the city government’s latest attempt to stem a four-month-old protest movement.

Instead of cowing protesters, the ban has enraged them. Crowds shouting “Hong Kong resist” and “wearing a mask is not a crime” marched through the city centre, Kowloon district and several other areas under a sea of umbrellas.

The first few hours were peaceful but in late afternoon the protests slipped into violence after police tried to disperse the crowds. They fired teargas and used rubber bullets and pepper spray; protesters responded with bricks and molotov cocktails, and vandalised businesses thought to be pro-China.

China’s military also warned protesters they could be arrested for targeting the People’s Liberation Army barracks with laser lights, the first direct interaction between China’s military and Hong Kong’s protesters, Reuters reported. They unfurled a yellow flag with the arrest warning on their roof.

Earlier on Sunday judges had refused a second attempt to get an injunction against the mask ban, but agreed to a judicial review of the chief executive Carrie Lam’s use of emergency powers. The court did not set a date but indicated it would be this month.

This is the first time in more than half a century that Hong Kong’s government has activated the emergency regulations ordinance, which gives Lam virtually unlimited power. Critics say it is unjustified, and a first step towards authoritarianism.

“We are frightened and furious. It is exactly because we are frightened that we need to come out and march,” said one protester, a graduate of the same school as Lam, carrying a school banner.

“We wanted to say she has brought shame on our school. And to remind her of our motto: ‘Live by the truth in love.’ We feel she violates it.”

Like almost everyone else at the marches, the protester wore a mask, even though that is an offence that now carries a fine and up to a year in jail. Police said they made the first arrests for violating it on Sunday.

Masks have been common at marches for months, because people fear that if they are caught on camera and identified by the authorities they could be arrested or face retaliation in the future.

Lam claimed the ban was the only way to restore order to a city that has been convulsed by the protests for nearly four months. More than 1,120 people have been injured, more than 2,000 arrested, thousands of rounds of teargas fired and two teenage students seriously wounded by live ammunition.

But since she unveiled it on Friday, the new law appears to have deepened Hong Kong’s crisis, prompting three straight days of chaos.

“If the law is allowed to stand, we don’t have any future, that’s why we have come here,” said one 23-year-old marching on Sunday with a group of friends. “Nowadays all Hong Kong people are fighters.”

On Saturday, protesters had called for a “day of rest” before Sunday’s larger protests but the city was virtually paralysed after authorities closed the entire metro system, and many banks, supermarkets and other businesses decided to shut for the day.

Trump promised China US silence on Hong Kong protests during trade talks Read more

The protests were originally sparked by an extradition bill that would have allowed people to be sent for trial in mainland China, but have swelled into a much broader movement with goals including greater democracy and an independent investigation of police brutality.

It is the biggest political crisis for the territory since the handover from British colonial rule in 1997, and one of the most serious challenges to China’s strongman leader, Xi Jinping, since he took power.

Although Hong Kong is officially self-ruled under the agreement that ended colonial rule, its leader is effectively handpicked by Beijing, and ultimately answers to the Communist party leadership there.

Worries about media safety also deepened on Sunday after police detained and beat one journalist, and protesters hit another reporter with a molotov cocktail. Several correspondents have been injured, and one lost her sight in one eye after she was hit in the face by a rubber bullet fired at short range.