A bill that bans the wearing of masks during a riot or unlawful assembly and carries a maximum 10-year prison sentence with a conviction of the offence became law today.

Bill C-309, a private member's bill introduced by Conservative MP Blake Richards in 2011, passed third reading in the Senate on May 23 and was proclaimed law during a royal assent ceremony in the Senate this afternoon.

Richards, MP for Wild Rose, Alta., said the bill is meant to give police an added tool to prevent lawful protests from becoming violent riots, and that it will help police identify people who engage in vandalism or other illegal acts. The bill is something that police, municipal authorities and businesses hit hard by riots in Toronto, Vancouver, Montreal and other cities in recent years, were asking for, according to Richards.

"The provisions of my bill are effective immediately, which means police officers across Canada now have access to these tools to protect the public from masked rioters," Richards said in a statement being released today.

The bill creates a new Criminal Code offence that makes it illegal to wear a mask or otherwise conceal your identity during a riot or unlawful assembly. Exceptions can be made if someone can prove they have a "lawful excuse" for covering their face such as religious or medical reasons.

The bill originally proposed a penalty of up to five years, but the House of Commons justice committee amended it and doubled the penalty to up to 10 years in prison for committing the offence.

Richards noted in his statement how rare it is for a private member's bill to become law and said that its final passage is the culmination of two years of work and a lot of consultation with police and business owners.

Bill comes into force immediately upon royal assent

"We can all rest easier tonight knowing our communities have been made safer with its passage," said Richards.

The bill didn't have unanimous support, and was opposed by some who are concerned about its effect on freedom of expression and privacy. Critics said the measures are unnecessary because the Criminal Code already includes a section about wearing disguises while committing a crime.

Civil liberties advocates argued the measures could create a chilling effect on free speech and that peaceful protesters can unintentionally find themselves involved in an unlawful assembly. They also noted that there are legitimate reasons for wearing masks at protests; some may be worried about reprisals at work, for example, if sighted at a political protest.

"Any law that infringes upon civil liberties needs to be held to a test of absolute necessity, and I don't think that test has been met in this instance," said Michael Byers, a political scientist at the University of British Columbia and a board member of the B.C. Civil Liberties Association, in an interview. Byers testified at the Commons justice committee that studied the bill.

Byers said freedom of expression was not properly factored into the design of the bill and that its measures could deter acts of political expression.

Richards argues that his bill will actually help protect the legitimate right to protest because it will help prevent illegitimate protesters from infiltrating a peaceful event and causing trouble. He also said police told him the existing Criminal Code provision about disguises is more geared toward armed robbery offences and is difficult to apply in protest situations.

In a recent interview, Richards said there is a lot of misunderstanding about his bill and that there will always be people who disagree with it.

He said he is proud to have identified a problem and created a solution. The bill becomes law when it receives royal assent.