HONG KONG — Hong Kong leader Carrie Lam banned protesters from wearing masks in a hardening of the government’s stance on the territory’s most disruptive crisis since it reverted to Chinese rule in 1997.

Lam announced the ban at an afternoon news conference where she decried the escalation of violence recently after four months of anti-government demonstrations. The mask ban takes effect Saturday and applies to people at “illegal” gatherings who use violence and exempts those who wear masks for “legitimate need.” Lam said she would go to the legislature later to get legal backing for the rule.

Thousands of masked protesters chanted slogans calling for greater democracy as they marched in the city’s business district before Lam spoke. They chanted “I want to wear face masks” and “Wearing mask is not a crime” as many cars, stuck in traffic due to the march, honked in support.

“Will they arrest 100,000 people on the street? The government is trying to intimidate us but at this moment, I don’t think the people will be scared,” one protester, who gave his surname as Lui, told an online live broadcast.

At the nearby Causeway Bay shopping area, a huge crowd also occupied streets to protest the mask ban. Smaller rallies were also held in several other areas.

Analysts warned the use of the Emergency Ordinance for the first time in over half a decade set a dangerous precedent. The law, a relic of British rule enacted in 1922 to quell a seamen’s strike and last used to crush riots in 1967, gives broad powers to the city’s chief executive to implement regulations in an emergency.

“Even though the mask ban is just a small move under the Emergency Ordinance, it is a dangerous first step. If the anti-mask legislation proves to be ineffective, it could lead the way to more draconian measures such as a curfew and other infringement of civil liberties,” said Willy Lam, adjunct professor at the Chinese University.

The ban followed widespread violence in the city Tuesday that marred China’s National Day and included a police officer shooting a protester, the first victim of gunfire since the protests started in June over a now-shelved extradition bill. The wounded teenager was charged with attacking police and rioting.

The movement has since snowballed into an anti-China campaign amid anger over what many view as Beijing’s interference in Hong Kong’s autonomy. More than 1,750 people have been detained so far.

Activists and many legislators have warned the mask ban could be counter-productive, impractical and difficult to enforce in a city bubbling with anger and where tens of thousands have often defied police bans on rallies to take to the street.

“Five demands, not one less,” many protesters shouted during Friday’s rallies as they held up five fingers.

The government last month withdrew the extradition bill, widely slammed as an example of the erosion of Hong Kong’s freedom, but protesters have widened their demands to include direct elections for the city’s leaders, an independent inquiry into alleged police brutality, the unconditional release of protesters and not characterizing the protests as riots.