Hong Kong’s chief executive Carrie Lam has invoked rarely used emergency laws to ban the wearing of face masks at protests, a move that is expected to provoke an angry backlash from the pro-democracy movement.

Ministers said the law would make it easier to identify and prosecute those taking part in the sorts of violent protests that have plagued the city since the unrest began in June.

Ms Lam announced the measure at a news conference on Friday, saying her government could not stand by as Hong Kong entered a “state of extensive and serious public danger”.

The text of the emergency anti-mask law, handed out to reporters, stated that protesters wearing masks faced up to one year in prison. Anyone on the street who refuses to remove a face mask when asked to do so by a police officer will be liable to up to six months in prison, it said.

The regulation would be effective from midnight, Ms Lam’s justice minister said.

The announcement followed government talks to stave off escalating violence after the police shooting of an 18-year-old protester. Ms Lam was flanked at the news conference by all 16 of her cabinet ministers, the first such display since she was sworn in as chief executive in July 2017.

Hong Kong protesters out in force after months of turmoil: In pictures Show all 32 1 /32 Hong Kong protesters out in force after months of turmoil: In pictures Hong Kong protesters out in force after months of turmoil: In pictures A protester throws a stone into a building at Hong Kong Polytechnic University on 11 November Reuters Hong Kong protesters out in force after months of turmoil: In pictures Police patrol the streets of Hong Kong the day after an officer shot a protester during a protest on 11 November EPA Hong Kong protesters out in force after months of turmoil: In pictures Riot police stand guard during a protest against police brutality in Hong Kong on 27 October EPA Hong Kong protesters out in force after months of turmoil: In pictures Protesters carry traffic cones to build a barricade during anti-government protests in Causeway Bay, Hong Kong on 11 November Reuters Hong Kong protesters out in force after months of turmoil: In pictures Protesters use obstacles and bricks to block a road in Hong Kong on 11 November AP Hong Kong protesters out in force after months of turmoil: In pictures Graffiti on a window smashed by student protesters in Hong Kong Polytechnic University AP Hong Kong protesters out in force after months of turmoil: In pictures Protesters carry US and British flags during a demonstration in Hong Kong on 11 November Reuters Hong Kong protesters out in force after months of turmoil: In pictures A protester throws a bottle of water as he is shrouded in tear gas during a demonstration in the Tsim Sha Tsui district of Hong Kong on 27 October Reuters Hong Kong protesters out in force after months of turmoil: In pictures Journalists take pictures of police officers as they move to disperse protesters in Hong Kong on 27 October Reuters Hong Kong protesters out in force after months of turmoil: In pictures An man lies injured after being attacked by protesters who suspected him of being an undercover police officer on 27 October EPA Hong Kong protesters out in force after months of turmoil: In pictures A man runs among tear gas during a protest in Hong Kong on 27 October Reuters Hong Kong protesters out in force after months of turmoil: In pictures Protesters gather on a field in the Tsim Sha Tsui district of Hong Kong on 27 October Reuters Hong Kong protesters out in force after months of turmoil: In pictures Pro-democracy protesters turn away from a fire lit outside the Causeway Bay Mass Rapid Transit (MTR) station in Hong Kong on 4 October Getty Hong Kong protesters out in force after months of turmoil: In pictures People rest near rows of riot police officers during a protest in Mong Kok, Hong Kong on 27 October Reuters Hong Kong protesters out in force after months of turmoil: In pictures Pro-democracy protesters hold umbrellas as police fire tear gas at them ouside Tai Koo MTR station in Hong Kong on 3 October Getty Hong Kong protesters out in force after months of turmoil: In pictures Hong Kong police fire a water cannon from the central government office at protesters during a mass rally on the 70th anniversary of the founding of communist China on October 1 AFP/Getty Hong Kong protesters out in force after months of turmoil: In pictures Protesters burn a Chinese national flag during a mass rally on the 70th anniversary of the founding of communist China on 1 October AFP/Getty Hong Kong protesters out in force after months of turmoil: In pictures Protesters remove signs celebrating the 70th anniversary of the founding of communist China during a mass rally in Hong Kong on 1 October AFP/Getty Hong Kong protesters out in force after months of turmoil: In pictures Cardboard boxes set alight by protesters burn in the streets of Hong Kong during a mass rally on the 70th anniversary of the founding of communist China on 1 October EPA Hong Kong protesters out in force after months of turmoil: In pictures An anti-China banner has been placed in a barricade during a mass rally on the 70th anniversary of the founding of communist China on 1 October EPA Hong Kong protesters out in force after months of turmoil: In pictures A pro-democracy protester runs away after police fire a tear gas canister in Hong Kong's Wong Tai Sin district on October 4 Reuters Hong Kong protesters out in force after months of turmoil: In pictures Protesters run after police fire tear gas during a mass rally on the 70th anniversary of the founding of communist China on 4 October AFP/Getty Hong Kong protesters out in force after months of turmoil: In pictures Pro-democracy protester take cover after police fire a tear gas canister in Hong Kong's Wong Tai Sin district on 4 October Reuters Hong Kong protesters out in force after months of turmoil: In pictures The rally comes after months of protests on the streets of Hong Kong which began in oppposition to a proposed extradition bill EPA Hong Kong protesters out in force after months of turmoil: In pictures The extradition bill would have allowed the government to extradite people to China if they were facing certain criminal charges AFP/Getty Hong Kong protesters out in force after months of turmoil: In pictures Opposition to the bill stems from the fear that the Chinese government would abuse this power for political or commercial reasons EPA Hong Kong protesters out in force after months of turmoil: In pictures Protesters soon came to demand greater freedom and universal suffrage under the One Country, Two Systems principle AFP/Getty Hong Kong protesters out in force after months of turmoil: In pictures Protesters are wearing black to symbolise opposition to China as they take to the streets in a "day of grief" while the Chinese state celebrates the 70th anniversary of its communist founding AFP/Getty Hong Kong protesters out in force after months of turmoil: In pictures A protester charges forward holding umbrellas as a mass rally breaks out in violence in Hong Kong on 1 October AFP/Getty Hong Kong protesters out in force after months of turmoil: In pictures A protester pours water on a tear gas canister fired by police during a mass rally on the 70th anniversary of the founding of communist China on 1 October Reuters Hong Kong protesters out in force after months of turmoil: In pictures A protester carries a vandalised Chinese flag through Hong Kong during a mass rally on the 70th anniversary of the founding of communist China on 1 October EPA Hong Kong protesters out in force after months of turmoil: In pictures Protesters carry a banner that denounces the celebration of the 70th anniversary of the founding of communist China on 1 October EPA

The Emergency Regulations Ordinance is a sweeping colonial-era law that was first drafted to quash workers’ strikes. It has not been invoked in Hong Kong since the riots of 1967.

Legal experts have warned that invoking emergency laws gives the chief executive free rein to bypass the city’s legislature and make any regulations she considers in the public interest.

On Friday, thousands of masked protesters took to the streets to march as a sign of defiance.

“After so many months the government has refused to answer our demands,” said one protester, who asked to be identified as just Chan, at a demonstration in the city’s central district.

“Police brutality is becoming more serious and the set up of an anti-mask law is to threaten us from protesting,” the 27-year-old financial industry worker told Reuters.

Amnesty International accused the Hong Kong government of “us[ing] emergency rules as a smokescreen for further tightening restrictions on protesters”.

“This is yet another attempt by the Hong Kong government to deter protesters, who have so far been undaunted by unnecessary and excessive use of force and the threat of prosecution, from exercising their rights,” said Joshua Rosenzweig, head of Amnesty International East Asia.

In a statement, the UK foreign secretary Dominic Raab said: “Political dialogue is the only way to resolve the situation in Hong Kong. While governments need to ensure the security and safety of their people, they must avoid aggravating and instead reduce tensions.”

The main Hong Kong government headquarters was closed from noon ahead of the announcement, in what appeared to be an indication that authorities expected it to be met with resistance.

On social media, a number of people shared notices from the city’s Education Bureau apparently warning schools to cancel sports matches and after-school activities for the next three days because of “uncertainty and safety concerns” around the government announcement.

There remain questions as to how easily a ban could be enforced in a city where many routinely wear masks in public to avoid germs and air pollution.

Ms Lam said the law included “exemption clauses” for those who “have legitimate need to wear masks”.

The government had been reluctant until now to invoke emergency laws because of the message it might send to the international community, not to mention investors with stakes in the global financial hub.

But with some calls from the pro-Beijing wing for a blanket general curfew, officials have been framing the measure as the lesser of two evils.

Ms Lam said foreign investment was important to the city, and that the law was needed “to restore a safe and stable environment for our citizens and enterprises”.

Bans on face coverings in certain circumstances were used “in many jurisdictions around the world”, Ms Lam told reporters. “I would also stress that, yes, we are using the Emergency Regulations Ordinance, but it does not mean that Hong Kong is in a state of emergency.