Britain's Prime Minister Boris Johnson speaks during the weekly question time debate in Parliament in London, Britain, January 22, 2020, in this screen grab taken from video. Parliament TV/Reuters TV via REUTERS

LONDON (Reuters) - Britain moved a step closer to its Jan. 31 exit from the European Union when the legislation required to ratify its deal with Brussels passed its final stage in parliament on Wednesday.

The bill will officially become law when it receives Royal Assent from Queen Elizabeth, something that could happen as soon as Thursday.

“At times it felt like we would never cross the Brexit finish line, but we’ve done it,” Prime Minister Boris Johnson said in a statement.

“Parliament has passed the Withdrawal Agreement Bill, meaning we will leave the EU on 31 January and move forwards as one United Kingdom.”

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.

Johnson had refused to accept any changes to the bill, which will enact Britain’s departure from the EU, facing down opposition lawmakers 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 in Britain.

A consent vote in the EU Parliament will take place on Jan 29.

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.