LONDON — Prime Minister Boris Johnson's government on Wednesday threatened to override elements of the Brexit withdrawal agreement painfully negotiated with the European Union, a move that E.U. leaders charged — and a British minister acknowledged — could breach international law.

The proposed legislation could amount to a negotiating tactic as London and Brussels try to hash out a permanent trade deal, to take effect when an 11-month transition period ends in December. It could also sour Britain’s relationship with its closest European allies, just when it needs them most, and increase the chances that the United Kingdom quits the E.U. without a trade deal in place, risking further economic turmoil in the midst of a pandemic.

Senior E.U. leaders blasted the idea.

“Very concerned about announcements from the British government on its intentions to breach the Withdrawal Agreement,” European Commission President Ursula von der Leyen wrote on Twitter. “This would break international law and undermines trust.”

Other European officials confessed they were unsure how to interpret what was happening.

“You know, the British and Boris Johnson in particular are always in a bluffing strategy. We should remain calm, but we need to be prepared,” French Trade Minister Franck Riester told France’s BFM Business radio on Wednesday. “Because, in the eventuality of a no-deal, we must be absolutely prepared for the consequences, which will be difficult.”

When Brandon Lewis, who serves in Johnson’s cabinet as the minister for Northern Ireland, was asked whether the proposed legislation would breach international law, he conceded that it would, in “a very specific and limited way.”

The proposed legislation introduced Wednesday in Parliament could unravel protections previously agreed upon by Britain and Europe to safeguard peace in Northern Ireland. The bill would allow Britain to forgo requirements for inspections and paperwork for goods shipped across the Irish Sea from Northern Ireland to other parts of the United Kingdom. It would also allow Britain to set its own rules for providing targeted state aid to economic sectors in Northern Ireland, possibly undermining European demands for “level playing fields.”

The issue of how to manage the border between the Republic of Ireland, which will remain in the European Union, and Northern Ireland, which will leave the E.U. along with the rest of the United Kingdom, has been one of the most vexing in the long Brexit saga.

Downing Street said the legislation, called the Internal Market Bill, is needed to set out trading rules between the United Kingdom and the E.U. if the two sides do not strike a deal by the end of the year.

Johnson, in Parliament on Wednesday, called the bill a “legal safety net to protect our country against extreme or irrational interpretations of the protocol which could lead to a border down the Irish Sea.”

The bill would need to be debated and passed in both houses of Parliament before becoming law. Johnson’s Conservative Party holds a comfortable majority in the House of Commons, and he can generally bank on support. But this latest move prompted backlash from within the party.

Theresa May, who as Johnson’s predecessor exhausted many months trying to secure a Brexit deal, implored in the House of Commons, “How can the government reassure future international partners that the U.K. can be trusted to abide by the legal obligations of the agreements it signs?”

A second former prime minister from Johnson’s party, John Major, suggested Britain was selling cheap its hard-won trust. “Our signature on any Treaty or Agreement has been sacrosanct,” Major said in a statement. “If we lose our reputation for honouring the promises we make, we will have lost something beyond price that may never be regained.”

Tobias Ellwood, a chair of the defense select committee, said to the BBC on Wednesday, “How can we look at countries such as China in the eye and complain about them breaching international obligations over Hong Kong or indeed Russia with ballistic missile treaties or indeed Iran over the nuclear deal if we go down this road?”

The head of the government’s legal department, Jonathan Jones, quit his post Tuesday, reportedly because of concerns over the legislation.

The prime minister’s spokesman said that the E.U. withdrawal agreement was not like other treaties and was agreed “at pace,” containing “ambiguities” that were always going to need clarification.

During last year’s general election, Johnson described the deal as “oven ready.”

Anand Menon, a professor of European politics at King’s College London, assessed that Downing Street’s maneuverings were aimed at a specific domestic audience.

“They are signaling two things,” Menon said. “If there is a no-deal Brexit, Johnson will have been seen to have tried everything he could to stand up for Britain’s interests. Even more interestingly, in the event there is a deal that involves a certain amount of concessions made by the prime minister, this actually shields him from accusations of selling out.”

Rob Ford, a professor of politics at the University of Manchester, said moves by the Johnson administration “sometimes feel like a squid squirting a great pile of ink just to startle its predator. . . . They create a fog of rhetoric that creates a cover for retreating, just as the squid does.” He said it is possible Britain could ultimately give ground on key areas in the current divorce talks — fishing rights and state aid are two major sticking points — and “just wanted a big domestic distraction.”

But, he said, there are consequences.

“The cumulative effect is to corrode trust in the administration,” he said. “And that’s dangerous if you are going to need to negotiate with various other international actors.”

The United Kingdom hopes that, once it is freed from Europe’s regulatory rules, it can strike new trade deals with countries around the world, including the United States.

Kim Darroch, Britain’s former ambassador to Washington, told BBC’s Newsnight program that as he watches Johnson’s current handling of Brexit, he wonders if there is an “aspect of the way Donald Trump would have done it and how he is doing it.”

In Brussels, policymakers watched the bill’s unveiling with a mixture of resignation and dismay. Several diplomats said they were not sure whether the British move was a negotiating tactic or serious, but they also said they had given up trying to decide after years of stunts in the House of Commons.

“Nothing surprises us anymore,” said one senior E.U. diplomat, speaking on the condition of anonymity to offer a weary, frank assessment of Brussels’s view of London. “Let us see what they do at the last moment, not what they say.”

Birnbaum reported from Riga, Latvia. Quentin Ariès in Brussels contributed to this report.