British Prime Minister Theresa May avoided a major blow to her Brexit strategy on Tuesday after lawmakers rejected a plan that would have given parliament a veto on the final deal negotiated with Brussels.
The House of Commons voted 324 to 298 to defeat an amendment to the EU (Withdrawal) Bill which would have removed her government's power to decide to leave the bloc without any agreement.
But in unusual scenes, ministers were forced to offer a last-minute compromise to pro-European MPs, negotiated in part in huddles in the chamber as the debate raged.
May had feared a rebellion by members of her Conservative Party over the motion, one of 15 submitted by the unelected upper House of Lords being considered by MPs over the course of two days.
The pro-European cause was boosted when junior justice minister Phillip Lee, a friend of May's, resigned shortly before the debate in order to back the veto amendment.
In the end Lee abstained, saying he trusted the premier to give parliament a "voice" in a compromise motion due to be presented when the bill returns to the Lords on Monday.
May met with more than a dozen Tory would-be rebels shortly before the vote to reassure them, although exactly what she promised is in dispute.
A statement from the Brexit ministry said the government had agreed to "look for a compromise".
But it made clear that "we have not, and will not, agree to the House of Commons binding the government's hands".
Talks with Brussels have stalled over the fraught issue of the Irish border, but both sides are hoping to agree a deal by October in time for the Brexit date of March 29, 2019.
- 'Immense crisis' -
The EU (Withdrawal) Bill would formally end Britain's membership of the European Union and transfer more than 40 years of European law onto the British statute books.
May is seeking to overturn 14 of 15 Lords amendments, but has a fight on her hands due to her fragile majority in the 650-seat Commons.
She had already agreed to give MPs a vote on the final Brexit deal, but rejecting it could see Britain crash out of the EU with no agreement.
The Lords amendment would have given parliament the power to decide what happened next, with the possibility of reopening negotiations or staying in the bloc.
Following its defeat, the government's own version of the amendment will now go forward.
Solicitor General Robert Buckland promised to discuss incorporating concerns raised by former attorney general and rebel Dominic Grieve.
Grieve proposed the government be forced to seek parliamentary approval for its strategy if it has not agreed a Brexit deal by the end of November.
"If we don't achieve a deal at all, the fact is we are going to be facing an immense crisis," he told MPs.
"The question is how do we take some sensible steps to anticipate that happening and try to make sure that there is a coherent process for dealing with it."
- 'Over the cliff' -
May's approach to rebel MPs on Tuesday reflects her wider handling of the government, which is deeply divided on Brexit and only held together through careful compromises.
But with crunch time approaching, tensions are rising, and during Tuesday's debate angry eurosceptics accused their rivals of trying to undermine the 2016 Brexit referendum.
"The decision was taken by the people, we gave them that decision and we have to stand by it," said Conservative MP Bill Cash.
His pro-European colleague Anna Soubry hit back at those seeking to "take us over the cliff of hard Brexit".
She has previously spoken of the threats she faced for challenging the government, and revealed Tuesday that one colleague was too scared this week to vote as they wanted.
In other votes Tuesday, the government successfully overturned an amendment seeking to remove the date of Brexit from the face of the bill.
Further clashes were expected on Wednesday over how closely Britain stays aligned with the EU's economy after leaving.
British Prime Minister Theresa May avoided a major blow to her Brexit strategy after lawmakers rejected a plan that would have given parliament a veto on the final deal negotiated with Brussels.
Britain's Prime Minister Theresa May had warned that defeat on the bill would weaken her hand in Brexit talks