FILE PHOTO: Horse Racing - Royal Ascot - Ascot Racecourse, Ascot, Britain - June 23, 2018 Britain's Queen Elizabeth at the Ascot Racecourse Action Images via Reuters/Paul Childs/File Photo

LONDON (Reuters) - Britain’s Queen Elizabeth granted royal assent to Prime Minister Theresa May’s flagship Brexit legislation on Tuesday, ending months of debate over the legislation that will formally end the country’s European Union membership.

The House of Commons speaker John Bercow said the EU withdrawal bill, passed by both houses of parliament last week, had been signed into law by the monarch, to cheers from Conservative lawmakers.

“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,” Commons Speaker John Bercow told lawmakers during a session of the house.