Quebec's secularism bill reflects the wishes of the Quebecois nation, the government said after introducing legislation Thursday prohibiting many public sector workers from wearing religious symbols and blocking their ability to challenge the bill over rights violations.

The Coalition Avenir Quebec legislation would affect elementary and high school teachers, Crown prosecutors, police officers, prison guards and judges, among others. Immigration, Diversity and Inclusiveness Minister Simon Jolin-Barrette said Bill 21 is an affirmation of Quebec's distinctiveness and its decades-long drive to separate church and state.

But the bill directly affects religious minorities such as Muslims and Sikhs, who will be prohibited from openly displaying their faith and working in what the government considers positions of authority. Jolin-Barrette said for the Quebec state to be truly secular, it cannot employ people who exercise authority while wearing religious symbols.

In the face of criticism from civil rights groups and organizations representing religious minorities, the bill declares the law will have effect "notwithstanding" protections in the Canadian Charter of Rights and Freedoms and "despite" protections in the provincial Charter of Human Rights and Freedoms.

The federal and Quebec charters protect the freedoms of conscience and religious expression and the right to equality. But they also include provisions allowing governments to pass laws overriding those rights. Jolin-Barrette said the notwithstanding clause has been used more than 100 times in Quebec, and the province is within its power under the Canadian Constitution to use it in this case.

"Quebec is a nation," he said. "No one contests this reality and our fundamental right to decide our own future and the orientations of our society."

Speaking to reporters in St. Stephen, N.B., Thursday, Prime Minister Justin Trudeau said the bill opens the door to discrimination.

"I think one of the things that a lot of Quebecers are going to be asking in the coming hours and days is about how this proposed law is actually going to work," he said.

"And quite frankly, I expect a large number of Quebecers to have some serious questions about that, because Quebecers, like all Canadians, are proud of living in a free and just society, and I don't think a lot of people feel that in a free society we should be legitimizing discrimination of our citizens based on religion."

The legislation includes what Premier Francois Legault on Thursday called a "compromise," granting an acquired right to people wearing religious symbols who already work in public sector jobs targeted by the legislation. The government also introduced a motion calling for the withdrawal of the crucifix from the provincial legislature once Bill 21 is adopted.

The crucifix has hung above the Speaker's chair in the national assembly since 1936, and the Legault government said last October it would not remove it because it is an important part of the province's heritage.

Robert Leckey, dean of McGill University's law school, said Legault's compromise is quite limited. Current teachers, according to the bill, can keep their symbols "as long as they exercise the same function within the same school board."

Leckey said that is "unpleasantly narrow. You can't be promoted or change school boards and wear a religious symbol." Additionally, he said, the sweep of people captured by the bill goes much further than originally anticipated.

However, because of the use of the notwithstanding clause, he sees no obvious avenues to challenge the law in the courts.

Bill 21 aims to fulfil a central Coalition Avenir Quebec election promise, and Legault has said the initiative is supported by a majority of Quebecers.

The previous Liberal government passed Bill 62 in October 2017, which required public services to be given and received with an uncovered face. That law is being challenged in court on the grounds it discriminates against women wearing the niqab or burka.

Jolin-Barrette's bill includes a similar provision requiring people to uncover their face when giving or receiving a state service, but unlike the Liberal law, the legislation is shielded from challenge by the notwithstanding clause.

Bill 21 includes specific wording for judges. Leckey said constitutional principles of judicial independence prevent the government from interfering with them "too directly." The Conseil de la magistrature, which oversees the conduct of provincially appointed judges, will have the final say on how the rules apply to the judiciary.

The bill was strongly denounced by other politicians including NDP Leader Jagmeet Singh, a practising Sikh who wears a turban, and Montreal Mayor Valerie Plante.

"I remember how I felt when I was younger, when I felt I wasn't welcome," Singh told reporters in Ottawa. "And now I think of young people across Quebec who won't be able to do their dream jobs."

Plante said she is "very concerned" about the law. "The government is entering a slippery slope and going against certain fundamental principles of the Quebec and Canadian charters of rights and freedoms," she said.

Jolin-Barrette said his government is building on the legacy of Quebec's Quiet Revolution, when the first steps were taken to separate church and state. "The responsibility of the current generation is to appropriate this precious heritage and create a future that inspires those who will follow," he said.

But Leckey warned that laws governing the public sector have a way of influencing people's behaviour in private business. Visible minorities already have a harder time finding jobs in Quebec than the white francophone majority, he said, and the bill reinforces the idea that a person can be judged based on his appearance.

"The government is encouraging these kinds of ideas rather trying than trying to root them out," he said.