London (AFP) - 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.
"At times it felt like we would never cross the Brexit finish line, but we've done it," Johnson said in a statement.
"Now we can put the rancour and division of the past three years behind us and focus on delivering a bright, exciting future."
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 then agreed changes to the text with Brussels, only to be defeated again by MPs unable to agree on the timetable for turning his new deal into law.
He accused them 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 agreement.
The Lords put up a minor fight this week.
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.
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.
In a speech early next month, Johnson is expected to set out more detail of his hopes for a free trade agreement with Brussels along the lines of the EU's recent deal with Canada.
"I'm absolutely confident that we can do that," Johnson said on Wednesday while taking questions online from members of the public.
He wants to both preserve free-flowing commerce between Britain and its largest trading partner across the Channel, and strike agreements with other countries -- namely the United States.
Brussels has warned that it is impossible to address all issues in that time, suggesting a more limited deal is now likely.
But while UK finance minister Sajid Javid admitted on Wednesday that it was a "tight timetable", he agreed with Johnson that it could be done.
The premier's office denied a row with Washington over London's proposed tax on tech giants would affect trade negotiations after Brexit, saying: "It's not part of the discussions."