The Quebec government has passed a controversial immigration reform bill which will scrap thousands of ongoing applications to live and work in the province.

Bill 9 was voted into law by the ruling Coalition Avenir Quebec party after a marathon 19-hour session in the National Assembly in the early hours of Sunday June 16. It passed 62 to 42.

Opposition parties said the measure, which scraps immigration applications from 18,000 skilled workers and refunds their fees, forcing them to start over again, is extreme and undemocratic.

Including the applicants' families, the fates of some 50,000 people wishing to emigrate to Quebec are at stake.

The government’s use of the legislative mechanism of closure, allowed it to end debate and use its majority to force a vote.

The legislation gives the province more authority over who receives permanent residency, which will involve a “values test” for would-be immigrants.

Liberal MNA Dominique Anglade slammed the CAQ government for forcing the bill through in a rush before politicians take their summer vacation.

“We are trying to attract the best talent in the world,” she said.

“We are a welcoming society and with this we are sending a very wrong message, and they're underestimating the impact long-term."

That sentiment was echoed by every opposition party in the house, with Quebec Solidaire spokesperson Gabriel Nadeau-Dubois calling it "unjustified, useless and a show of force."

The province’s minister for immigration, Simon Jolin-Barrette, said the bill will help Quebec’s economy.

“At 4:08 am this morning, Bill 9, An Act to enhance Québec's economic prosperity and respond adequately to the needs of the labor market through the successful integration of immigrants, was adopted,” he tweeted.

Premier Francois Legault defended the bill, insisting he's doing the right thing to better meet the needs of Quebec’s job market.

"What I want Quebecers to understand is that I'm exactly doing what they wanted," he said.

Legault's CAQ party wants to revamp the immigration process by focusing on workers needed in rural areas of the province.

The government said the new selection criteria will permit it to fast-track newcomers who better meet the needs of employers. Applicants in the old system were selected on a first-come, first-served basis.

The federation of Quebec's chambers of commerce saluted its passing.

"The concerted efforts of the government will lead to a better link between the skills of immigrants and those required for positions to fill in Quebec companies," the federation's president, Stephane Forget, said in a statement.

"These changes will have a very important impact to facilitate the recruitment of future employees ... and therefore, better integration of immigrants."

Values test unclear

Daniel Beland, director of McGill’s Institute for the Study of Canada, told CTV News Channel, said it’s not clear what the values test will look like.

“Permanent residency involves the federal government so what you will have here is bargaining between the local government and the Trudeau government over this test and other provisions that are central to Bill 9,” he said. “They (CAQ) might not get everything they want from it.”

“One of the goals of this bill is to reduce unemployment for new immigrants who come to Quebec, we’ll see if this has a positive effect over time,” “Certainly it’s controversial, not just the content of the bill, but also the way it was passed at 4 a.m. after this closure procedure that was adopted. So I think there is quite a bit of discontent about that on the opposition side.”

Toronto-based immigration lawyer Max Chaudhary told CTV News Channel the government is well within its authority to pass the law.

“The amount of fairness owed to foreign nationals seeking immigration to Quebec is quite limited, and as such this is consistent with an economic focus for Quebec,” he said.

He said the values test could be subject to a challenge under the Charter of Rights and Freedoms but it depends on “how specific and how culturally-driven the criteria is.”

“It is a reality that there are too many people immigrating to the urban centres of Quebec so it does make logical common sense for the government to try to incentivize the candidates to go to rural parts of Quebec, assuming there is an economic need,” he added.

The legislature continues sitting Sunday to debate Bill 21, controversial secularism legislation that would ban public servants including teachers, police officers, Crown prosecutors and prison guards from wearing religious symbols on the job.

--- With files from The Canadian Press