A government minister has said a new bill to amend the UK's Brexit deal with the EU will "break international law".
Concerns had been raised about legislation being brought forward which could change parts of the withdrawal agreement, negotiated last year.
Northern Ireland Secretary Brandon Lewis conceded it would go against the treaty in a "specific and limited way".
Former PM Theresa May warned the change could damage "trust" in the UK over future trade deals with other states.
The permanent secretary to the Government Legal Department, Sir Jonathan Jones, has announced he is resigning from government in light of the bill, making him the sixth senior civil servant to leave Whitehall this year.
Sir Jonathan, who is the government's most senior lawyer, is understood to have believed the plans went too far in breaching the government's obligations under international law.
Labour leader Sir Keir Starmer condemned the bill and accused No 10 of "reopening old arguments that had been settled", saying the "focus should be on getting a [trade] deal done" with the EU.
No 10 revealed on Monday that it would be introducing a new UK Internal Market Bill that could affect post-Brexit customs and trade rules in Northern Ireland.
Downing Street said it would only make "minor clarifications in extremely specific areas" - but it worried some in Brussels and Westminster that it could see the government try to change the withdrawal agreement, which became international law when the UK left the EU in January.
The row also comes at the start of the eighth round of post-Brexit trade deal talks between the UK and the EU.
The two sides are trying to secure a deal before the end of the transition period on 31 December, which will see the UK going onto World Trade Organisation rules if no agreement is reached.
Irish Foreign Affairs Minister, Simon Coveney, called Mr Lewis' comments "gravely concerning", adding: "Any unilateral departure from the terms of the withdrawal agreement would be a matter of considerable concern and a very serious step."
The UK's chief Brexit negotiator, Lord David Frost, called for "realism" from his EU counterparts, saying he would "drive home our clear message that we must make progress this week if we are to reach an agreement in time".
The EU said it would "do everything in [its] power to reach an agreement" with the UK, but "will be ready" for a no-deal scenario.
On Monday, Boris Johnson said if a deal hadn't been done by the time the European Council meets on 15 October, the two sides should "move on" and accept the UK's exit without one.
Shadow Northern Ireland secretary, Louise Haigh, said it was "deeply concerning" that the prime minister "appeared to be undermining the legal obligations of his own deal" with the introduction of the new law while the negotiations are taking place.
'Rule of law'
The text of the new bill will not be published until Wednesday, although the government has confirmed it will deal with the issue of the so-called Northern Ireland Protocol - an element of the withdrawal agreement designed to prevent a hard border returning to the island of Ireland after Brexit.
The practicalities of the protocol - which will deal with issues of state aid (financial support given to businesses by governments) and whether there needs to be customs checks on goods - is still being negotiated by a joint UK and EU committee.
But Mr Lewis said the bill would take "limited and reasonable steps to create a safety net" if the negotiations failed.
Speaking during an urgent question on the bill, chair of the Justice Committee and Tory MP Bob Neill said the "adherence to the rule of law is not negotiable".
He asked Mr Lewis: "Will he assure us that nothing proposed in this legislation does or potentially might breach international obligations or international legal arrangements?"
The Northern Ireland secretary replied: "Yes. This does break international law in a very specific and limited way."
He said the government was still working "in good faith" with the EU joint committee to overcome its concerns for the future of trade in Northern Ireland, but said there was "clear precedence for UK and indeed other countries needing to consider their obligations if circumstances change".
Sir Bob later told BBC Radio 4's PM the decision was "troubling", adding: "Britain is a country which prides itself on standing by the rule of law... whether it is inconvenient or convenient for us.
"Whatever we seek to do, if we find something we signed up to 'inconvenient', I am afraid this doesn't mean we can renege on our contract... as that would damage our reputation long term."
This was an extremely unusual statement - a minister standing up in Parliament to say the government is planning to break international law.
Brandon Lewis told the House of Commons that "there are clear precedents for the UK and other countries needing to consider their international obligations as circumstances change".
That may suggest, says Catherine Barnard, professor of law at the University of Cambridge, that the government is looking at Article 62 of the Vienna Convention on the Law of Treaties, which enables a state to get out of its treaty obligations when circumstances change radically.
But those changed circumstances have to be pretty dramatic - something like the dissolution of Yugoslavia, when a recognised country ceases to exist.
In the case of the Northern Ireland Protocol, it is less than a year since the government negotiated the treaty in full knowledge of the sensitivity of the situation.
And if the government does go ahead with legislation which appears to contradict the withdrawal agreement?
"There is a chance," says Prof Barnard, "that the EU will decide to trigger the dispute resolution mechanism in the withdrawal agreement, which could lead to arbitration and a case before the European Court of Justice."
Theresa May - who stood down as prime minister last year after her own Brexit deal failed to get the support of Parliament - said: "The United Kingdom government signed the withdrawal agreement with the Northern Ireland Protocol.
"This Parliament voted that withdrawal agreement into UK legislation. The government is now changing the operation of that agreement."
"How can the government reassure future international partners that the UK can be trusted to abide by the legal obligations of the agreements it signs?"
The leader of the Liberal Democrats, Sir Ed Davey, also called it a "sad and shocking state of affairs for our country".
Sammy Wilson, who acts as Brexit spokesman for the Northern Irish Democratic Unionist Party, said he was "pleased" to have the new bill that could deal with some of the issues that could affect his constituents - such as state aid and customs checks.
But he said the DUP had "warned ministers of the impact of the withdrawal agreement" early on, saying it was a "union splitting, economy destroying and border creating agreement that has to be changed and replaced".
He added: "We will judge this bill on whether it delivers on these kind of issues."
However, Claire Hanna, a Social Democratic and Labour Party (SDLP) MP for Belfast South, said the protocol was "a symptom… of four years of terrible political decision making".
She added: "It is now the law. This government is obliged to implement it in full."
She also "cautioned" Mr Lewis "not to use the threat of a border on the island of Ireland or the hard won impartiality of the Good Friday Agreement as a cat's paw in this or any other negotiation."
But former Conservative leader, Sir Iain Duncan Smith, said the act that brought the withdrawal agreement into law in the UK allowed the government to "reserve the right to make clarifications under the sovereignty clause".
Mr Lewis agreed, saying the law would "clarify... the points about what will apply in January if we are not able to get satisfactory and mutually suitable conclusions" in negotiations.
He added: "It is reasonable and sensible to give that certainty and clarity to the people and businesses of Northern Ireland."