British Prime Minister Boris Johnson's controversial Brexit legislation, enabling the UK to break international law, has cleared the House of Commons.

MPs voted 340 to 256, majority 84, in favour of the United Kingdom Internal Market Bill at third reading, despite warnings that the "law-breaking" legislation threatens the union and the country's global reputation.

Ministers have defended powers contained in the legislation, which gives them the opportunity to override the Brexit divorce deal.

They argue such powers are needed to protect the relationship between Great Britain and Northern Ireland, amid concerns in Westminster that Brussels could seek to disrupt food goods travelling from Britain to Northern Ireland as part of trade talks.

The government was forced to compromise earlier in the Bill's passage in the face of a Tory backbench rebellion, which resulted in changes to give MPs a vote before ministers can use the powers which would breach the Withdrawal Agreement brokered with Brussels last year.

Opposition MPs have warned it will give the UK government the chance to stray into matters which are devolved in Scotland, Wales and Northern Ireland, branding it an "attack" on devolution.

Speaking at 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 United Kingdom."

Mr Sharma accused SNP Westminster leader Ian Blackford of wanting to be "shackled to the European Union forever", to which Mr Blackford replied: "You're talking nonsense."

Shadow business secretary Ed Miliband said Labour supported the principle of the internal market, but opposed the "law-breaking" Bill.

He said: "On international law, nobody should be in any doubt the damage already done by this Bill.

"This law-breaking Bill has been noticed around the world."

Mr Miliband 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."