After years of acrimonious debate, British lawmakers on Wednesday finally approved the terms of their country's historic departure from the European Union - due in just nine days time. MPs in the lower House of Commons had already backed the EU Withdrawal Agreement Bill, which ratifies the divorce deal that Prime Minister Boris Johnson struck with Brussels last year.
But the unelected upper House of Lords made some changes this week, including on the rights of EU citizens and child refugees after Brexit.
In a series of votes on Wednesday, the Commons - where Johnson's Conservatives have a large majority - rejected all five amendments and sent the bill back to the Lords, who then reluctantly agreed to back down.
The only hurdle left to formal ratification now is royal assent by Queen Elizabeth II, which could come as soon as Thursday, paving the way for Britain to leave the EU on January 31.
The European Parliament still has to back the deal in a vote next week but its approval in London is a historic moment, as Britain edges closer to becoming the first country to leave the 28-member EU.
It is a huge personal achievement for Johnson, who took office last year promising to end several years of political wrangling that had divided the country and paralysed successive governments.
His predecessor, Theresa May, negotiated a Brexit deal with Brussels in 2018 but the Commons rejected it three times, forcing her to resign.
Johnson agreed changes to the text with Brussels, only to be defeated again by MPs unable to agree on the timetable for turning the deal into law.
Johnson accused lawmakers of trying to frustrate the result of the landmark 2016 referendum vote for Brexit and forced a snap election last month.
The result, with Johnson returned to office on a thumping majority, fundamentally upended the dynamic and MPs swiftly backed the deal.
The Lords put up a minor fight.
One amendment sought to alter the government's scheme to register around 3.6 million EU citizens living in Britain, to give them physical documents proving their right to stay.
Another change would have required the government to negotiate the right of unaccompanied child refugees in the EU to join relatives in Britain.
Downing Street said it was time to finish the long-running process, which has divided the nation.
"The British people have waited for more than three years to get Brexit done. Passing the WAB allows us to do this in an orderly way on January 31," Johnson's spokesman said.
The Brexit deal protects the rights of EU citizens, makes special trading arrangements for the British province of Northern Ireland, and settles the UK's EU debts.
It also paves the way for transition phase until December 31, in which UK-EU ties will remain largely the same while both sides try to agree a new trading and security partnership.
But the shape of that future relationship remains unresolved - and negotiating it could pose an even bigger challenge than agreeing the divorce.