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 European Union, 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.
Brussels has warned it will "not be shy" in taking legal action if the UK government does not agree to the demand.
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.
US presidential candidate Joe Biden also issued a warning over the prime minister's plans.
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.
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.
Ed Miliband, Labour's shadow business secretary, described the legislation as "indefensible" and urged the House of Lords to "bring this bill into compliance with the rule of law and salvage our reputation".
He highlighted reservations from US President Donald Trump's Northern Ireland envoy, Mick Mulvaney, adding: "When the Trump administration starts expressing concern about your adherence to international agreements and the rule of law, you know you are in trouble.
"That is how bad this bill is."
After the Commons approved the third reading of the bill, Conservative co-chairman Amanda Milling criticised Labour's opposition to the legislation.
"On their final opportunity to stand up for the integrity of the UK, Labour have unsurprisingly again chosen to side with the EU," she said.
"For all their talk of new leadership, Labour's actions tell a very different story - they won't stand up to Brussels, they won't protect the Union and Sir Keir Starmer won't rule out working with Nicola Sturgeon to rip our country apart.
"Our UK Internal Market Bill protects the Union and ensures we can preserve peace in Northern Ireland, delivering on our manifesto promise to ensure unfettered trade across the whole United Kingdom."