It was a free vote, meaning Liberal backbenchers were not required to toe the party line. They did, however, come under pressure from the government, including Trudeau.

But most Liberal backbenchers, along with Conservative and New Democrat MPs, ignored Trudeau's warning. The bill passed by a vote of 222-60.

Just hours before the vote late Wednesday in the House of Commons, Trudeau said the proposed law is unconstitutional because it intrudes on provincial jurisdiction. He recommended that MPs vote against it.

OTTAWA — Liberal backbenchers have defied Prime Minister Justin Trudeau, voting in favour of a bill that would bar health and life insurance companies from forcing clients to disclose the results of genetic testing.

Prime Minister Justin Trudeau answers a question during question period in the House of Commons in Ottawa, March 8, 2017. (Photo: Adrian Wyld/The Canadian Press)

Earlier in the day, Trudeau told a news conference that the federal government has to consider multiple factors when making decisions on legislation, including defending the rights of Canadians and upholding their freedom from discrimination.

He added that it also has to defend the Constitution and the balance of power between federal and provincial jurisdictions, he added.

"The government has taken a position that one of the elements in the proposed bill is unconstitutional," Trudeau said. "That is the recommendation we had and the government position is to vote against that particular ... element in the bill."

Wilson-Raybould opposed bill

Justice Minister Jody Wilson-Raybould had gone to some lengths to rally opposition to the bill. Last week, she sent a letter to the head of the Council of the Federation, which comprises the country's premiers, which appeared designed to solicit provincial and territorial support for the federal government's position.

"Given the important constitutional issues in play, we call on the Council of the Federation to communicate its views on the constitutionality of Bill S-201's proposal to regulate all contracts, agreements, and goods and services to prohibit genetic discrimination," Wilson-Raybould wrote.

The insurance industry has fiercely opposed an aspect of the legislation that would make it illegal for anyone to require a person to undergo genetic testing, or disclose the results of previous tests, as a condition of signing or continuing an insurance policy or any other good, service, contract or agreement.

If passed, it would also prohibit anyone from sharing genetic testing results without written consent, although there are exceptions for physicians and researchers.

A breach of the proposed law would result in a fine of up to $1 million, or five years behind bars.

Gov't amendment defeated

The government had proposed an amendment that would have stripped the bill of everything except the power to make genetic characteristics a prohibited ground of discrimination under the Canadian Human Rights Act. It was defeated by a vote of 218-59.

The amendment would have gutted the legislation, said Rob Oliphant — the Liberal MP who shepherded the bill, originally proposed by now-retired Sen. James Cowan, through the Commons.

It would have meant the bill would apply only to federally regulated employees, who account for just five to seven per cent of the population.

Oliphant argued that the bill is an appropriate federal response in an area where provinces and territories have failed to act for a dozen years. And he noted that three legal experts testified before the Commons justice committee about its constitutionality.

With files from Joanna Smith

Also on HuffPost