The British government has won the vote on the controversial bill that gives it power to override parts of the Brexit withdrawal agreement and possibly break international law.
The Internal Market Bill has been met with strong opposition from some British MPs and the EU, which has threatened legal action if it is implemented.
The legislation threatens to undermine the already-floundering Brexit negotiations between the two parties.
It allows goods and services to flow freely across the UK when it leaves the EU's single market and Customs union on January 1.
It also gives the government power to change parts of the legally binding withdrawal agreement.
Supporters say it contains crucial protection for Northern Ireland and the rest of the UK if future talks fall apart.
But critics, including many in the ruling Conservative party, say it will damage the UK's reputation by breaching international law.
The bill was passed by a government majority of 77 on Monday evening, with 340 MPs for to 263 against.
It will now go to a debate and vote in the House of Lords before it is enshrined into law.
Prime Minister Boris Johnson earlier told MPs in the House of Commons that he had “absolutely no desire to use these measures", which were "an insurance policy".
Rebellions will probably follow in the next few weeks as the legislation receives more scrutiny.
The government was expected to pass the bill but Mr Johnson earlier faced increasing opposition with the resignation of one of his special envoys.
Rehman Chishti announced his departure from his role as the UK's special envoy on freedom of religion or belief in a letter to Mr Johnson on Monday.
"I’ve written to the PM resigning as the PM’s special envoy," Mr Chishti wrote on Twitter.
"I can’t support the Internal Market Bill in its current form, which unilaterally breaks the UK’s legal commitments.
“As an MP for 10 years and former barrister, values of respecting rule of law and honouring one’s word are dear to me."
Mr Chishti is the first MP from Mr Johnson’s party to resign over the move.
"Having read your letter to colleagues, as well as wider statements on the matter, I will not be able to support this bill on a matter of principle,” his resignation letter said.
"I have real concerns with the UK unilaterally breaking its legal commitments under the withdrawal agreement.
"I feel strongly about keeping the commitments we make; if we give our word, then we must honour it."
Earlier on Monday, former prime minister David Cameron also spoke against the bill, saying he had "misgivings" about it and breaking an international treaty should be the "final resort".
Mr Chishti had taken up the special envoy position a year ago and had been overseeing a report by the Bishop of Truro into how the British government could better respond to the plight of persecuted Christians around the world.
The hard-hitting report, which had been commissioned by the former foreign secretary Jeremy Hunt, made 22 ambitious recommendations.