Ottawa: The Canadian Parliament passed a ban on masks at riots that punishes violations with up to 10 years behind bars in a bid to crack down on radical groups.

The measure, adopted 153 to 126 on the Halloween holiday that sees revellers walk the streets in masks and costumed, aims to target the “growing threat” of vandalism and violence, said parliamentarian Blake Richards, who sponsored the bill.

Lawmakers are especially targeting the Black Bloc anarchist group, whose members dress in black, their faces hidden by glasses, scarves and hoods.

They have sometimes showed violence during massive student protests against plans to raise university tuition costs in Quebec.

The bill sets 10 years in prison for people who wear a mask during a riot without legitimate excuses, and five years if it is an illegal protest.

Opposition members said the law was not necessary because the criminal code already sets punitive measures.

“The police already have all the tools that they need: we saw that in Quebec,” said New Democratic Party Leader Tom Mulcair.

Interim Liberal Leader Bob Rae stressed the bill had broad implications.

“Are we going to ban people from appearing in a protest because they are wearing a burka?” he asked. “Are we going to say that on a cold day that people can’t wear a mask?”