Britain has moved a step closer to its January 31 exit from the EU, when the legislation required to ratify its deal with Brussels passed its final stage in parliament.

The bill will officially become law when it receives royal assent from the Queen, something that could happen as soon as Thursday.

Earlier on Wednesday, the lower house of parliament, the House of Commons, overturned changes the upper house, the House of Lords, had made to the legislation, including a clause to ensure protections for child refugees after Brexit.

Prime Minister Boris Johnson had refused to accept any changes to the Withdrawal Agreement Bill, which will enact Britain’s departure from the EU, facing down opposition MPs who say he has hardened its terms.

The Lords could have sought to reinstate the changes, but opted not to, allowing the legislation to clear its final hurdle.

Johnson’s Conservatives won a large majority in the House of Commons in a general election last month, enabling the government to bring an end to more than three years of wrangling in parliament over Britain’s EU exit.