FILE PHOTO: A view of the Houses of Parliament during the general election in London, Britain, December 12, 2019. REUTERS/Hannah McKay

LONDON (Reuters) - The bill implementing Britain’s exit deal with the European Union officially became law on Thursday ahead of the country’s departure from the bloc next week.

The legislation passed its final parliamentary stage on Wednesday, after more than three years of bitter wrangling over how, when and even if Brexit should take place.

Queen Elizabeth has now given it Royal Assent, the leader of the House of Commons, Jacob Rees-Mogg, said on Twitter.

Britain is due to leave the bloc at 2300 GMT on Jan. 31. A consent vote in the EU Parliament will take place on Jan 29.

Prime Minister Boris Johnson is expected to formally sign the Withdrawal Agreement in the coming days.