U.K. Prime Minister Boris Johnson’s plan to renege on part of the Brexit divorce deal passed its first hurdle in Parliament late Monday after a bruising debate in which senior members of his party denounced the move.

The House of Commons passed the Internal Market Bill by 340 to 263 votes on its first main vote, allowing it to go through the next stage in the parliamentary process on Tuesday.

The prime minister said the proposed legislation, which will rewrite part of the withdrawal agreement, is “essential” to maintain the U.K.’s economic and political integrity. He accused the European Union of making “absurd” threats to stop food moving from mainland Great Britain to Northern Ireland.

“The EU hasn’t taken that particular revolver off the table,” Johnson told MPs. “It is such an extraordinary threat, and it seems so incredible the EU could do so, that we are not taking powers in this bill to neutralize that threat, but obviously reserve the right to do so.”

Johnson’s plan has thrown Brexit talks into turmoil. Last week, the EU threatened legal action in response and demanded he withdraw the proposed law by the end of September, a request the government has rejected.

If it passes Parliament, the bill risks sinking negotiations with the EU over a crucial trade agreement. Without that, Britain will face an economic shock at the year-end as tariffs and quotas are introduced on commerce with its biggest trading partner.

Members of Parliament on both sides of the house said the government’s admission that the proposed legislation would breach international law would weaken Britain’s place in the world and its attempts to call other countries -- including Russia, China and Zimbabwe -- to account.

“Britain has been a beacon in some very difficult places of the world for support for the rule of law and our support is relied upon,” former Tory International Development Secretary Andrew Mitchell said. “We have a duty to uphold the rule of law.”

Conservative former Attorneys General Geoffrey Cox and Jeremy Wright said they wouldn’t back a bill that breaks international law, and were joined by former finance minister Sajid Javid. Rehman Chishti, Johnson’s special envoy for freedom of religion or belief, quit earlier in the day, saying he couldn’t vote for the plan.

“I understand how some people will feel unease over the use of these powers, and I share that sentiment myself and I have absolutely no desire to use these measures,” Johnson said. “They are an insurance policy, and if we reach agreement with our European friends -- which I still believe is possible -- they will never be invoked.”

Tory rebels did offer the prime minister a potential way out with a proposed amendment -- which wasn’t put to a vote on Monday -- that would require the government to hold a further vote in the House of Commons before it could change the terms of the withdrawal agreement.

Opposition lawmakers lined up to accuse Johnson of failing to deliver on his promise at December’s general election that his deal was “oven ready.” They also said he had failed to live up to his claims that he had provided protection against the exact issues on the Irish border he is now seeking to repair.

“It’s his deal, his mess, his failure,” Ed Miliband, Labour’s business spokesman, told the Commons. “This is the wrong thing to do, it’s not necessary and it’s deeply damaging for the country.”