British Prime Minister Boris Johnson has lost a senior law officer and has been forced into a compromise over controversial plans to break international law by overriding the Brexit Withdrawal Agreement.
The UK Government will table an amendment to its Internal Market Bill, giving MPs a vote before it can use powers which would breach the deal brokered with Brussels last year.
Around 30 Tory rebels were thought to be preparing to vote for an amendment on Tuesday which would have required a Commons vote before the provisions in the Bill relating to Northern Ireland could come into force.
Downing Street relented and announced in a joint statement with Conservative MPs Sir Bob Neill and Damian Green that it would seek to amend the Bill to require the Commons to vote before a minister can use the "notwithstanding" powers contained within it.
The statement said: "Following constructive talks over the last few days, the Government has agreed to table an amendment for Committee Stage.
"This amendment will require the House of Commons to vote for a motion before a minister can use the 'notwithstanding' powers contained in the UK Internal Market Bill.
"The Internal Market Bill was designed to give MPs and Peers a vote on the use of these powers via statutory instrument.
"But following talks, it is agreed that the Parliamentary procedure suggested by some colleagues provides a clearer, more explicit democratic mandate for the use of these powers, and also provides more legal certainty.
"The Government will table another amendment which sets clear limits on the scope and timeliness of judicial review into the exercise of these powers. This will provide people and businesses with the certainty that they need.
"We welcome the way the Parliamentary Party has come together on these issues. There is near-unanimous agreement that the Government must be able to use these powers as a final resort, that there must be legal certainty, and that no further amendments are required on these powers."
It came after the Government's top law officer for Scotland resigned amid reports he was unhappy about the plans to override the Withdrawal Agreement.
Lord Keen of Elie QC, the Advocate General, tendered his resignation to Mr Johnson this morning.
In his resignation letter, he said: "Over the past week I have found it increasingly difficult to reconcile what I consider to be my obligations as a Law Officer with your policy intentions with respect to the UKIM Bill.
"I have endeavoured to identify a respectable argument for the provisions at clauses 42 to 45 of the Bill but it is now clear that this will not meet your policy intentions.
"In these circumstances I consider that it is my duty to tender my resignation from your Government.
"Your Government faces challenges on a number of fronts and I fear that the UKIM Bill in its present form will not make these any easier. I wish you well in dealing with these issues."
A Downing Street spokesman said: "Lord Keen has resigned as Advocate General for Scotland.
The Prime Minister thanks him for his service."
The announcement came less than two hours after Boris Johnson was unable to tell MPs whether the peer was still in his Government.
Giving evidence to the Commons Liaison Committee, Mr Johnson said: "As far as I know, conversations on that matter are continuing."
The Government has already seen the departure of the head of the Government Legal Department, Jonathan Jones, who quit last week as the Bill was announced.
Earlier, Mr Johnson had said he had full confidence that Britain and the EU will avoid a cliff-edge "no deal" at the end of this year.
"It's not what this country wants (no deal) and it's not what our EU friends and partners want from us.
"Therefore I have every hope and expectation that that will not be the outcome," he told MPs.
However, Mr Johnson said the EU had "signally failed" to rule out a possible "blockade" between Britain and Northern Ireland if there is no deal, once a post-Brexit transition period ends on 31 December.
"It's always possible that I'm mistaken and perhaps they will prove my suspicions wrong" in ongoing talks, he said.
But otherwise, the unilateral new bill to regulate the UK's internal market was needed as an insurance policy.
"I prefer to have protections that guarantee the integrity of this country and protect against the potential rupture of the United Kingdom," Mr Johnson said.
A "no deal" outcome would see tariffs imposed by both sides, and on Britain's side, they "would be quite formidable for some of their products", he added.
NI Secretary: My answer on breaking the law was correct
Northern Ireland's Secretary of State has said his answer last week in parliament saying that the British government's plans broke international law was accurate.
Asked last week if anything in the proposed legislation did breach or potentially breached international legal obligations or arrangements, Northern Ireland minister Brandon Lewis said: "Yes, this does break international law in a very specific and limited way."
When he was asked about his remark today, Mr Lewis said: "The answer I gave was a very clear answer to a very specific question.
"The answer I gave was correct."
Speaking at a parliamentary committee, Mr Lewis also expressed optimism for a solution to the legislation row.
"The bill does outline the safety net that we want to put in place, should it be needed," Mr Lewis said.
"But as the prime minister outlined, that is not something we're looking to do, it is not something we want to do and I'm optimistic that through the free trade negotiations and the joint committee work, that we will be able to get a positive resolution so that we don't need to look at getting to that point in the first place."
Last week, Ms Pelosi warned there will be no US-UK trade deal if proposed changes to the Withdrawal Agreement threaten the peace process or lead to the return of a hard border.