The UK government has published plans to get rid of parts of the post-Brexit deal it agreed with the EU in 2019.
It wants to change the Northern Ireland Protocol to make it easier for some goods to flow from Great Britain to Northern Ireland.
But the EU opposes the move, saying that going back on the deal breaches international law.
The government said there is "no other way" of safeguarding essential interests of the UK.
It argues the term "necessity" is used in international law to justify situations where "the only way a state can safeguard an essential interest" is by disapplying - or breaking - another international obligation.
It adds that action taken must not "seriously impair" essential interests of other states.
The alterations are set out in the Northern Ireland Protocol Bill, to be debated and voted on by Parliament.
The government is promising to remove "unnecessary" paperwork on goods checks and that businesses in Northern Ireland will get the same tax breaks as those elsewhere in the UK.
The bill will also ensure that any trade disputes are resolved by "independent arbitration" and not by the European Court of Justice, it adds.
Foreign Secretary Liz Truss said it was "a reasonable, practical solution to the problems facing Northern Ireland" and that the UK could "only make progress through negotiations if the EU are willing to change the protocol itself", adding: "At the moment they aren't."
"We are very clear that we're acting in line with the law," she said.
The government said it would prefer a "negotiated solution" with the EU that avoids the need for the bill to become law.
Businesses which import Great Britain goods to Northern Ireland have experienced difficulties with the protocol as the checks and controls add cost and complexity.
Food and horticulture importers have faced the greatest problems, as those goods face the most onerous controls.
However, exporters, including food exporters, have benefited because unlike other parts of the UK they have maintained frictionless access to EU markets.
Irish Prime Minister Micheál Martin called for negotiations between the UK and EU to deal with the impasse.
Scottish First Minister Nicola Sturgeon said the government's legislation risks a "deeply damaging" trade war with the EU.
Shadow Foreign Secretary David Lammy said it was "a desperate attempt by Boris Johnson to distract from the drama of his leadership crisis".
Meanwhile, Stuart Anderson from the Northern Ireland Chamber of Commerce and Industry said it was ready to play its part in supporting lasting solutions that work for businesses and households.
"While there are attractive elements in today's proposals for consumer facing businesses in particular, a careful balance must be struck to protect gains made to date by our exporters and agri-food sub-sectors," he said.