British lawmakers on Monday backed a new bill that would override parts of the Brexit treaty struck with the European Union last year, despite outrage in Brussels and alarm at home over such an overt breach of international law.

MPs in the House of Commons gave their initial approval to the UK Internal Market Bill by 340 votes to 263, clearing the way for four days of detailed scrutiny of the text this week and next.

Prime Minister Boris Johnson earlier argued the legislation was a "safety net" against what he claimed were EU threats to impose tariffs on UK internal trade and even stop food going from mainland Britain to Northern Ireland.

Boris Johnson's government last week introduced a bill to override the EU treaty and unilaterally regulate UK trade
Boris Johnson's government last week introduced a bill to override the EU treaty and unilaterally regulate UK trade AFP / Ben STANSALL

But EU leaders have dismissed this as "spin" and warned Johnson to uphold commitments he himself made in the Brexit treaty last year -- demanding he withdraw the offending parts of the new bill by the end of September.

The row threatens to disrupt already tough post-Brexit trade negotiations, fuelling growing fears of failure that would see more than four decades of EU-UK integration come to a crashing halt at the end of this year.

The legislation also sparked angry debate in London, reminiscent of the years of bitter political battles that followed the 2016 shock referendum vote to leave the EU.

Several of Johnson's own Conservative MPs expressed alarm about breaking international law, with ex-finance minister Sajid Javid and former attorney general Geoffrey Cox among those saying beforehand that they would not back the bill as it stood.

Details of the legally-binding agreement between the EU and UK covering checks on goods travelling through Northern Ireland
Details of the legally-binding agreement between the EU and UK covering checks on goods travelling through Northern Ireland AFP / Gillian HANDYSIDE

Every living former prime minister -- Conservatives John Major, David Cameron and Theresa May and Labour's Tony Blair and Gordon Brown -- also warned of the risk to Britain's global reputation.

Austrian Finance Minister Gernot Bluemel evoked the film "Groundhog Day" when speaking about the House of Commons debate over a bombshell new bill introduced by Johnson's Conservative government
Austrian Finance Minister Gernot Bluemel evoked the film "Groundhog Day" when speaking about the House of Commons debate over a bombshell new bill introduced by Johnson's Conservative government POOL / Kay Nietfeld

Britain left the EU in January but remains bound by the rules of the 27-member bloc until a transition period ends on December 31.

Johnson says the UK Internal Market Bill will ensure "unfettered access" for trade after that within the UK's four nations -- Scotland, England, Wales and Northern Ireland.

But the legislation would see London unilaterally regulate UK trade and state aid within Northern Ireland -- in violation of the Brexit treaty, that demands Brussels have a say.

Northern Ireland will uniquely remain subject to some EU rules after Brexit to ensure a free-flowing border with the Republic of Ireland -- a crucial part of the 1998 peace accords that ended decades of sectarian violence.

The government is determined to ram the UK Internal Market Bill through as quickly as possible, and senior minister Michael Gove believes it can avert a full-scale rebellion
The government is determined to ram the UK Internal Market Bill through as quickly as possible, and senior minister Michael Gove believes it can avert a full-scale rebellion AFP / JUSTIN TALLIS

But Johnson claimed the EU was ready to go to "extreme and unreasonable lengths" and to use these arrangements to "exert leverage" in the trade negotiations.

He acknowledged some personal "unease" at giving ministers powers to override the Brexit treaty but said they would not be needed if a trade deal was agreed as hoped with Brussels.

"What we cannot do now is tolerate a situation where our EU counterparts seriously believe that they have the power to break up our country," he said.

"That illusion must be decently despatched."

The UK parliament spent years arguing over how to leave the EU -- much of it arguing over arrangements for Northern Ireland -- and delayed its exit date three times.

Johnson temporarily halted the deadlock by sealing a divorce deal with Brussels late last year, which he used to win a thumping 80-seat victory in a December general election.

Downing Street last week claimed the Brexit deal was agreed "at pace" and the problems with the aspects of the treaty regarding Northern Ireland were unforeseen.

But opposition Labour spokesman Ed Miliband ridiculed this suggestion, saying: "Either he wasn't straight with the country about the deal in the first place or he didn't understand it."

He added: "This is his deal. It's his mess. It's his failure."

One of Johnson's special envoys, MP Rehman Chishti, earlier quit over the bill -- and more trouble could be ahead.

Although MPs on Monday defeated a Labour attempt to try to kill the bill, amendments have already been proposed for debate during four days of detailed scrutiny starting Tuesday.

One from senior Conservative MP Bob Neill has attracted some support, and would give parliament, not ministers, the power to decide whether to overrule the Brexit treaty.

Even some Brexit-backing Tories are unhappy, with one, Charles Walker, saying: "I'm no fan of the EU... but surely we have to exhaust all other options before we press the nuclear button."