The British government’s so-called Brexit legislation that would allow the country to leave European Union became law Tuesday after Queen Elizabeth II gave her approval.

House Commons Speaker John Bercow announced that the European Union Withdrawal Bill received royal assent and passed into law. The announcement was cheered by pro-Brexit officials.

“I have to notify the House in accordance with the Royal Assent Act 1967 that her Majesty has signified her royal assent to the following acts ... European Union Withdrawal Act 2018,” Bercow said.

The bill was finally approved after months of debate. The legislation will translate thousands of pieces of EU law into British statute. Pro-EU lawmakers and members of the House of Lords tried to amend it to soften the terms of Britain's departure from the bloc.

Most of the changes were reversed by narrow votes. Pro-EU lawmakers said they will try to defeat the government on other EU-related legislation if it tries to push for a “hard Brexit” that disrupts close economic ties between Britain and Europe.

The Associated Press contributed to this report.