Britain’s delayed and disputed Brexit bill became law on Thursday, removing the last U.K. obstacle to the country leaving the European Union in just over a week.

The U.K. is finally leaving the 28-nation bloc more than 3 1/2 years after voters narrowly opted to do so in a June 2016 referendum — and after interminable rounds of political wrangling.

Deputy Speaker Nigel Evans announced Thursday in the House of Commons that the Withdrawal Agreement Act had received royal assent from Queen Elizabeth II, the final formality in its legislative journey. An identical announcement was made by the speaker of Parliament’s upper House of Lords.

Evans’ brief announcement, which drew cheers of “Hear! Hear!” from some Conservative lawmakers in the Commons, came hours after the bill completed its passage through Parliament late Wednesday by getting approval from the House of Lords.

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

The EU Parliament also must ratify the Brexit divorce deal before Jan. 31, Britain’s scheduled departure date. The EU Parliament’s constitutional affairs committee voted by a large margin Thursday to approve the Brexit withdrawal deal, preparing the way for a vote of all European lawmakers in Brussels next Wednesday.

“It’s a historical moment, albeit a somber moment, for us. We deeply regret this outcome,” committee chair Antonio Tajani said after the 23-3 vote.

After years of divorce negotiations between the British government and the EU, U.K. lawmakers repeatedly defeated attempts by both Johnson and his predecessor Theresa May to finalize Britain’s departure terms with the other 27 nations of the bloc.

That changed when Johnson’s Conservatives won Britain’s Dec. 12 election, giving his government the ability to override the objections of opposition parties. Opposition members of the House of Lords battled to amend the withdrawal bill but were overruled by Johnson’s 80-strong majority in the Commons.

But deep divisions over Brexit remain.

After the royal assent was announced, Scottish National Party lawmaker Ian Blackford said the U.K. was in a “constitutional crisis” because the legislatures in Scotland, Wales and Northern Ireland did not back the Brexit bill.

“Boris Johnson has trampled over the democratic votes in Edinburgh, Belfast and Cardiff,” Blackford said.

The Scottish National Party says Scotland should hold a referendum on independence from the U.K., which Johnson refuses to allow.

Despite Johnson’s repeated promise to “get Brexit done” on Jan. 31, the day of departure only marks the start of the country’s EU exit.

Guy Verhofstadt, the leading EU lawmaker on Brexit, said the bloc’s parliament would continue to scrutinize the way Britain implemented the divorce agreement — especially to ensure that the rights of EU citizens living in the U.K. are protected after Brexit.

In February, Britain and the EU will begin negotiations on their future ties, racing to strike new relationships for trade, security and a host of other areas by the end of 2020.

Johnson insists he won’t agree to any delays in those talks beyond the end of the year. The U.K. is also keen to begin talks on a free trade deal with the United States, and intends to negotiate simultaneously with the EU and the U.S.

Speaking at the World Economic Forum in the Swiss ski resort of Davos, U.S. Treasury Secretary Steven Mnuchin said a deal with Britain was “an absolute priority of President Trump and we expect to complete that within this year.”

U.S. Commerce Secretary Wilbur Ross said a trade deal between the two countries shouldn’t be too difficult because their economies are similar.

“Both are very heavily services oriented and within services, such as financial services, there’s already a pretty high degree of integration and coordination, so it should be much easier mechanically,” he said in Davos.

But British opposition politicians are already raising concerns about issues ranging from food safety standards — especially the U.S. practice of chlorine washing chicken to kill germs — to drug prices.

Ross sought to dampen concerns that a trade deal would mean higher drug prices in the U.K. as U.S. pharmaceutical companies look to gain concessions from Britain’s state-run National Health Service.

“What we think is that drugs should have similar prices wherever they are but I don’t believe we are in any position to tell the U.K. what they should pay for drugs,” he said.

© The Associated Press. All rights reserved.