Defiant masked protesters rampaged, police fired tear gas and a teen was wounded by gunfire hours after Hong Kong's embattled leader banned masks at rallies, invoking rarely used emergency powers to quell four months of anti-government demonstrations.

Challenging the ban, which went into effect Saturday, thousands of protesters crammed streets in the central business district and other areas, shouting "Hong Kong people, resist!"

Two activists filed legal challenges late Friday on grounds the ban would instill fear and curtail freedom of speech, but a court denied their request for an injunction.

Pockets of angry protesters attacked Chinese bank outlets and shops, vandalized subway stations, and set street fires, prompting police to respond with tear gas in many areas.

One officer fired a single shot from his gun in self-defence after he was attacked by protesters in the northern Yuen Long district, said police spokesperson Yolanda Yu. She said a male was wounded, but that police didn't know exactly how he got shot.

A police official who requested anonymity because he wasn't authorized to speak to the news media said the male was 14 years old, but that he couldn't say if the teen was shot by the officer or hit by a stray bullet.

A hospital authority spokesperson said the teen was in serious but not critical condition.

He is the second victim of gunfire since pro-democracy protests began in June.

A man covers up his face and holds up his hand to represent the protesters' five demands in Hong Kong on Friday. Pro-democracy protesters marched in the city centre ahead of the city’s embattled leader announcing the ban of wearing masks during protests. (Vincent Thian/The Associated Press)

Ban applies to 'illegal' gatherings

Hong Kong Chief Executive Carrie Lam told a news conference Friday that the mask ban, imposed under a colonial-era Emergency Ordinance that was last used over half a century ago, would be "an effective deterrent to radical behaviour."

"We must save Hong Kong — the present Hong Kong and the future Hong Kong," she said. "We must stop the violence.… We can't just leave the situation to get worse and worse."

She bristled at the suggestion the ban nudged the territory closer to authoritarian rule, and said she was not acting under orders from Beijing, which she visited this week when Communist Party leaders celebrated 70 years in power.

But Yang Guang, a Chinese spokesperson for Hong Kong affairs, expressed support for the move late Friday, saying it was time for stern measures to end the conflict.

The mask ban applies to people at "illegal" gatherings who use violence, but exempts people who wear masks for "legitimate need."

Thousands of protesters crammed streets in the city's central business district and elsewhere to express their rage at the new ordinance, with the majority wearing masks of the type that will be outlawed in gatherings.

New slogans first heard today after passage of <a href="https://twitter.com/hashtag/AntiMaskLaw?src=hash&ref_src=twsrc%5Etfw">#AntiMaskLaw</a> include “Hongkongers, fight back”, “disband the <a href="https://twitter.com/hashtag/HongKong?src=hash&ref_src=twsrc%5Etfw">#HongKong</a> government” <a href="https://t.co/DiJnKUiUlu">pic.twitter.com/DiJnKUiUlu</a> —@VictorTing7

They chanted "I want to wear face masks" and "Wearing mask is not a crime" as cars, stuck in traffic due to the march, honked in support.

Lam said she isn't declaring a state of emergency despite deploying the colonial-era emergency law to impose the mask ban.

Hong Kong "isn't in a state of emergency," she said, but faces "extensive and very serious danger" after an alarming rise in violence during widespread protests on Tuesday.

She said the government will table legislation on the mask ban when the Legislative Council resumes Oct. 16.

Secretary for Security John Lee Ka-Chiu said the mask ban will carry a jail sentence of up to one year or a fine. Protesters will be prohibited from painting their faces to hide their identity.

Thousands of anti-government protesters block streets in central Hong Kong on Friday. The majority wearing masks of the type that will be outlawed in gatherings from midnight. (Jorge Silva/Reuters)

Also Friday, the United Nations human rights office said any new government measures must be grounded in law and protect the right to freedom of assembly.

Marta Hurtado, a UN human rights spokesperson, told a briefing in Geneva that "any restriction must have a basis in law, and be proportionate and as least intrusive as possible."

"Freedom of peaceful assembly is a fundamental right and should be enjoyed without restriction to the greatest extent possible."

U.K. Foreign Secretary Dominic Raab said the Hong Kong government should turn to political dialogue instead of aggravating tensions in months-long pro-democracy protests.

In a statement issued Friday, Raab said "political dialogue is the only way to resolve the situation in Hong Kong."

Government 'trying to intimidate us'

Even before it was announced, the plan faced opposition.

"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.

Lam says the mask ban takes effect Saturday and applies to people at 'illegal' gatherings who use violence. It exempts people who wear masks for 'legitimate need.' (Mohd Rasfan/AFP/Getty Images)

Analysts warned the use of the Emergency Ordinance for the first time in over half a century set a dangerous precedent. The law, a relic of British rule enacted in 1922 to quell a mariners 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.

WATCH: Prominent protester Joshua Wong speaks out after ban

Prominent Hong Kong protester Joshua Wong called for international awareness of potential 'martial law' in the territory after chief executive Carrie Lam banned masks at protests. 0:24

The ban followed widespread violence in Hong Kong on 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 man, 18, 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.

Activists and many legislators have warned the mask ban could be counterproductive, impractical and difficult to enforce.

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

A masked anti-government protester is pictured in central Hong Kong on Friday. Activists and legislators are warning the mask ban could be counterproductive, impractical and difficult to enforce. (Jorge Silva/Reuters)

Alvin Yeung, Civic Party lawmaker, said introducing anti-mask laws "will only escalate the situation," adding that unrest in Hong Kong was a "political issue and it should have been resolved politically months ago."

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: