LONDON (Reuters) - Lawmakers approved legislation on Thursday which will allow Britain to leave the European Union on Jan. 31 with an exit deal, ending more than three years of tumult over the terms of the unprecedented divorce.

They voted 330 to 231 in favor of the European Union (Withdrawal Agreement) Bill, which implements an exit deal agreed with the EU last year.

That allows Prime Minister Boris Johnson to turn the page on one of Britain’s deepest political crises in decades, putting an end to the fears of an immediate disorderly exit which had cast a shadow over the economy and fueled divisions over the 2016 referendum decision to leave the EU.

“It is time to get Brexit done. This bill does so,” Brexit minister Stephen Barclay told lawmakers, summing up hours of debate in parliament.

The legislation now heads to parliament’s upper chamber and is expected to become law in the coming weeks, leaving enough time to allow Britain to leave at the end of the month with a deal to minimize economic disruption.

In recent years, financial markets have been mesmerized by the twists and turns of Britain’s Brexit drama, with its acrimonious negotiations in Brussels, knife-edge votes in parliament and heavy defeats for unstable governments.

But after Johnson called a snap election late last year and then won a large majority by promising to deliver Brexit at the end of January, the uncertainty over when and how Britain will leave the EU has largely abated.

The focus has instead turned to upcoming talks on long-term arrangements with the EU that will kick in when a transition period - during which Britain remains subject to EU rules - ends on Dec. 31.

Johnson is adamant that the free-trade deal he wants can be negotiated in time, but his EU counterparts are less convinced.

On Wednesday, Johnson met European Commission President Ursula von der Leyen in London hours after she had made a speech saying it would be “basically impossible” to agree everything by the end of the year.

Johnson’s opponents, many of whom argued to stop Brexit or give the public another vote, say his approach risks creating another ‘no-deal’ cliff-edge at the end of the year when the transition period ends.

However, Von der Leyen has indicated that even if a whole deal cannot be negotiated in time, the most important and potentially disruptive parts can be prioritized.