Boris Johnson has seen MPs approve his controversial Brexit legislation, which ministers have admitted could lead to the UK breaching international law.
The UK Internal Market Bill, which has provoked a furious row with the EU, had its third reading passed by the House of Commons in a vote on Tuesday night, with a government majority of 84.
It means the proposed legislation, which has now cleared all its Commons stages, will move to the House of Lords.
The prime minister had ploughed ahead with the bill, parts of which will give ministers the power to override the Brexit divorce deal, despite the EU's call for him to withdraw those measures from the proposed legislation by the end of the month.
The government introduced the bill earlier this month to anger from both European capitals and at Westminster - including among a sizeable group of its own Conservative MPs.
Two weeks ago, Mr Johnson was forced into action to head off a growing rebellion among Tory backbenchers.
And his promise to give MPs a vote before any of the bill's powers are used ensured the safe passage of the bill's third reading on Tuesday night.
No Conservative MPs voted against the bill's third reading although former prime minister Theresa May - who has previously condemned the "reckless" legislation - was among a number of Tories not to record a vote.
Tory former attorney generals Geoffrey Cox and Jeremy Wright, who have also voiced concerns about the bill, were others not to record a vote.
The proposed legislation will now be considered by the House of Lords, where ministers might face a rougher ride as the government does not possess a majority in the upper house.
Many Tory peers - including former Conservative leader Michael Howard and ex-chancellor Norman Lamont, who are both Brexiteers - have also criticised the bill.
However, Downing Street has warned it would breach constitutional convention for the House of Lords to fully block the legislation.
The government has argued the bill is "critical" to ensuring the unfettered access for goods from Northern Ireland to the rest of the UK after the end of the Brexit transition period, and to protect the Good Friday Agreement.
At the opening of Tuesday's debate in the Commons - ahead of the vote on the bill's third reading - Business Secretary Alok Sharma told MPs: "Our approach will give businesses the regulatory clarity and certainty they want.
"It will ensure the cost of doing business in the UK stays as low as possible, and it'll do so without damaging and costly regulatory barriers emerging between the different parts of the UK."
He described those parts of the legislation that would allow the UK to override its Withdrawal Agreement with the EU as a "legal safety net" in case London and Brussels do not agree on how to implement the provisions for Northern Ireland in the agreement, which is known as the Northern Ireland Protocol.