Hong Kong's government, faced with months of pro-democracy protests that have spiraled into violence, on Friday invoked emergency powers to ban masks from public gatherings.

A look at how some other countries have dealt with masked protesters:

------

CANADA

Canada's Parliament passed a bill in 2013 banning people from hiding their faces during riots or unlawful assembly. But the office of the Minister of Public Safety stressed that wearing a mask during lawful protests is legal in Canada and that Canada's Constitution guarantees the right to peaceful assembly. The sponsor of the 2013 bill said at the time it was in response to the 2011 Stanley Cup riots in Vancouver, when often-masked vandals rampaged through the streets after their hockey team's Game 7 loss to Boston.

------

FRANCE

In March, following months of often violent yellow vest protests, the French Parliament passed a bill backed by President Emmanuel Macron's government to further prevent violence during protests and to help authorities maintain order. The so-called "anti-troublemakers" law made it a crime for protesters to conceal their faces, punishable by up to one year in prison and a 15,000 euro ($17,000) fine. The yellow vest movement broke out last winter to protest Macron's economic policies, seen as favouring the rich. Weekly demonstrations often turned into riots with people setting fires, ransacking luxury stores and clashing with police in Paris and other cities.

------

SPAIN

Although an early draft of a 2015 law on citizen security, popularly known as the "gag law," banned covering faces during public protests, that wasn't included in the final version approved by a majority of conservative lawmakers. The new law says the use of masks or other ways to cover one's face will be considered an aggravating factor during the commission of an offence, and fines can be heftier if a protester commits another offence while disguising one's identity.

------

AUSTRALIA

Australia doesn't ban masks, but in its second most populous city, Melbourne, police can direct a demonstrator wearing a mask to leave a protest area. Police must reasonably believe the demonstrator is wearing the face primarily to conceal his or her identity or as protection against crowd-controlling substances such as capsicum spray. Those wearing masks who refuse to leave can be charged with failing to comply with a police direction.

------

RUSSIA

Following a wave of anti-government protests, Russia introduced a ban on covering faces at public gatherings, arguing that face masks prevent police from identifying protesters in case they commit an offence. Following a complaint from activists in a provincial city who covered their mouths with duct tape in protest of gender and sexual identity discrimination, the constitutional Court in 2016 ruled that it is possible to cover your face in some ways. In practice, however, Russian police routinely pick up protesters who wear masks of any sort.

------

GERMANY/AUSTRIA

It is illegal to cover your face during public rallies, although both far-right and left-wing protesters often try to get around it by wearing sunglasses, baseball caps and scarves.

------

SOUTH KOREA

There is no mask ban in South Korea, where rallies are common but protesters rarely wear masks. In the past, prostitutes wearing masks, sunglasses and baseball caps to hide their identity rallied in Seoul to protest a government crackdown on red-light districts. Some defectors from North Koreas also use masks and sunglasses to hide their faces because of worries about the safety of their relatives in North Korea. In the 1980s, many pro-democracy activists wore masks because of tear gas fired by police.

------

THAILAND

After more than a decade of political unrest punctuated by anti-government protests and clashes with authorities, Thailand introduced aPublic Assembly Act in 2015 that severely restricts demonstrations. Among the regulations in the law, passed by the rubber-stamp legislature of the military junta at the time, is a provision outlawing demonstrators from dressing in a way that intentionally conceals their identity.

------

ZIMBABWE/SOUTH AFRICA

There is no law against wearing masks during protests in Zimbabwe, where frustration over a collapsing economy often erupts into street demonstrations. Some protesters in the southern African nation cover their faces to avoid being identified by police, who are accused of hunting down people afterward. In neighbouring South Africa, where protests over poor service delivery and other issues are common, the law bans the wearing of disguises or masks that obscure facial features and prevent identification. But some demonstrators wear masks anyway, sometimes to protect against tear gas, with little or no retaliation from police.

------

PALESTINIAN TERRITORIES

Palestinians protesting in Gaza and the Israeli-occupied West Bank often wrap their faces in black-and-white checkered headscarves known as kuffiyehs, a symbol of their national cause. Israeli forces tend to focus on the most violent protesters -- those throwing rocks or firebombs -- and such protesters often cover their faces to conceal their identity and reduce the effects of tear gas. Israel is known to use undercover security agents wearing balaclavas or kuffiyehs who infiltrate protests and then arrest people. In recent demonstrations in the West Bank, organizers have urged protesters not to shield their faces to make it more difficult for Israeli agents to blend in.