Boris Johnson's government has reached a compromise with its own backbench MPs to head off a potential rebellion against controversial plans to override part of the EU divorce deal, breaking international law.
Around 30 MPs from the ruling Conservative Party abstained as the UK Internal Market Bill passed its first parliamentary hurdle earlier this week. However politicians from all parties have spoken out against it, and the bill is likely still to face a rough ride before becoming law.
A new amendment will now be put forward meaning the House of Commons will have to approve any move by ministers to invoke powers leading to a breach of the EU divorce treaty.
A joint statement from two potential rebels, former ministers Sir Bob Neill and Damian Green, said the new procedure "provides a clearer, more explicit democratic mandate for the use of these powers", as well as "more legal certainty".
The compromise makes a revolt in the House of Commons less likely, but the bill is opposed by many in the upper chamber, the House of Lords. One member, Scotland's Advocate General Lord Keen, resigned from the government in protest on Wednesday.
The move is likely to make little difference with the EU, which has threatened legal action against the UK, demanding that the plan to rewrite the Brexit deal be removed altogether. It comes as trade talks reach a crucial stage, with an agreement needed next month.
The row concerns future arrangements for Northern Ireland, set out in a protocol as part of the binding Withdrawal Agreement. Negotiated by Boris Johnson with Brussels last year, it was ratified by the UK and the EU and has the force of an international treaty.
Under the deal, Northern Ireland will be obliged to follow some EU rules after the end of the post-Brexit transition period, to keep the politically sensitive border with the Irish Republic open after the UK leaves the EU's Single Market and Customs Union.
Boris Johnson's nationalist government now claims the EU's "extreme" interpretation of the accord threatens the UK's integrity. The bill, which it describes as a "safety net", would give the UK the power to set aside the divorce deal's provisions for Northern Ireland on state subsidies and border bureaucracy with Britain.
It has provoked a row over the impact this might have on the Good Friday Agreement, the 1998 peace deal which formally ended decades of sectarian violence.