MEPs in Brussels voted overwhelmingly in favour of the deal on Wednesday evening, by 621 votes to 49.
The result was met with a tiny smattering of applause before dozens of pro-Remain MEPs stood up, held each other’s hands and started singing “Auld Lang Syne”.
It will then enter into a “transition period” until December 31, in which the government will negotiate its future relationship with the bloc.
Nigel Farage, the Brexit Party leader and MEP who was a key driving force behind Brexit, had earlier launched one final attack on the “bullying” EU in his last European Parliament speech.
In an inflammatory address, he said: “We love Europe - we just hate the European Union.”
He was joined by fellow Brexit Party MEPs in mockingly waving goodbye with Union Jack flags, before filing out of the chamber.
Guy Verhofstadt, the high-profile anti-Brexit MEP, had started the debate by floating the prospect of the UK rejoining a more “effective and democratic” EU in the future.
“Brexit is also a failure of the union,” he said. “We have to recognise that. There’s a lesson to learn. The lesson is not to undo the union but reform the union.”
He signed off: “This vote is only an au revoir.”
Ursula von der Leyen, president of the European Commission, said of the impending negotiations: “Just to be very clear, I want the EU and UK to stay good friends and good partners.”
Read more from Yahoo News UK
Ms von der Leyen said the EU is considering a “unique” free trade agreement in which the UK would enjoy “zero tariffs” - but on condition of Mr Johnson committing to the bloc’s standards on workers’ rights and fair competition.
Mr Farage and his Brexit MEPs booed Ms von der Leyen at this point.