The Hong Kong government's decision to use a colonial-era emergency law to ban face masks at protests last year was both proportionate and legal, the city's top court ruled Monday.
The ruling is a blow for democracy supporters who had been hoping the Court of Final Appeal would side with a lower court and overturn the order.
It also confirms that Hong Kong's chief executive -- a pro-Beijing appointee -- has the power to enact any law in a time of public emergency without needing the approval of the city's partially elected legislature.
But its practical consequences were unclear, given that the government has made masks compulsory in public areas to combat the coronavirus pandemic.
Hong Kong was convulsed by seven straight months of huge and often violent pro-democracy protests last year.
They were eventually quashed by mass arrests, a virus-related ban on public gatherings and Beijing imposing a new national security law on the city in June.
Face masks became ubiquitous to reduce the risk of identification and prosecution for those taking part in peaceful marches, or violent clashes with police.
In October last year Chief Executive Carrie Lam banned anyone covering their face at public rallies, using the Emergency Regulations Ordinance, a British colonial law from 1922.
Opposition lawmakers challenged both the use of that emergency law and the ban on wearing masks at permitted rallies.
They argued the move breached Hong Kong's mini-constitution, the Basic Law.
A lower court had agreed with those bringing the challenge and expressed concerns about the emergency law and the proportionality of the mask ban.
But on Monday, a panel of top judges unanimously backed the government.
"The ambit of the power to make subsidiary legislation under the ERO in a situation of emergency or in circumstances of public danger, although wide and flexible, was not unconstitutional," the judges ruled.
Banning face masks at both illegal and legal rallies was proportionate because it was aimed at "the prevention and deterrence of violence before a peaceful public gathering had deteriorated into violence".
Antony Dapiran, a Hong Kong lawyer who has written books about the city's protest movement, said the judges' conclusions could prove controversial.
"Most striking is the extent to which the Court of Final Appeal judgment privileges one narrative -- of 'violence and lawlessness' -- over any other, and without the broader context in which those incidents occurred, in reaching their conclusion," he told AFP.
Hong Kong's judiciary has come under significant pressure in the politically polarised atmosphere that has blanketed the city.
Pro-democracy supporters have criticised some judgments that go against their camp.
But judges have also come under intense criticism from powerful pro-Beijing politicians and newspapers -- especially when suspected protesters have been acquitted.