Members of the European Parliament have overwhelmingly backed the terms of the UK's departure from the EU.
MEPs ratified the Brexit Withdrawal Agreement by 621 votes to 49 following an emotional debate in Brussels.
Some MEPs have marked the occasion with songs - others wore "always united" scarves. President of the European Commission Ursula von der Leyen told the UK: "We will always love you."
But Eurosceptics, including the Brexit Party's Nigel Farage, used their speeches to tear into the EU.
The UK is due to leave the bloc at 2300 GMT on Friday.
Ratification of the withdrawal agreement, agreed by the UK and EU in October, is not in doubt after it easily cleared its committee stage last week.
Signing the letter confirming the EU's consent, the Parliament's president, David Sassoli, said the two sides must heed the words of the late Labour MP Jo Cox when approaching their future relationship and recognise "there is more that unites us than divides us."
"You are leaving the EU but you will always be part of Europe…It is very hard to say goodbye. That is why, like my colleagues, I will say arrivederci."
The session saw those on either side of the Brexit debate, including the UK's 73 MEPs, celebrate or lament the end of British EU membership.
The Parliament's Brexit spokesman, Guy Verhofstadt, said it was "sad to see a country leaving that has twice given its blood to liberate Europe".
He added that British MEPs had brought "wit, charm, and intelligence" as well as "stubbornness", and would be missed.
Ursula von der Leyen says ratification of the withdrawal deal was "only a first step" towards a new partnership between the EU and the UK.
She says the two should "join forces" in areas such as climate change, and seek a close partnership following the UK's exit on Friday.
The EU president finished her speech by saying: "We will always love you, and we will not be far. Long live Europe."
Farage walk-out
Conservative MEP and prominent Eurosceptic Daniel Hannan said opinion in Britain turned against the bloc when it became clear "the aspiration was to have the EU as a quasi-state".
"If at any stage Britain had been able to have a trade-only relationship that would have been enough," he went on, but added: "You are losing a bad tenant and gaining a good neighbour."
Farage used his final speech to excoriate the EU, branding it "anti-democratic".
He has been campaigning for the UK's exit since before he was first elected to the Brussels Parliament in 1999.
"I want Brexit to start a debate right across Europe - what do we want from Europe?" Mr Farage said, arguing that "trade, friendship, co-operation and reciprocity" between nations could be achieved without "all of these institutions and all of this power".
He and his fellow Brexit Party MEPs waved Union flags before walking out of the chamber en masse.
A tearful Molly Scott Cato was applauded and hugged by her colleagues after she spoke of her "grief and regret" at Brexit and the hope she would return to the European Parliament "one day".
"While now is not the time to campaign to rejoin the EU, we must keep the dream alive," the Green Party MEP said.
Belgian MEP Philippe Lamberts said the EU must learn lessons from the UK's decision to leave.
He said the bloc had to "regain the hearts and minds of European citizens" by focusing on what it could do for the many, not the few.
Earlier, the S&D coalition, which houses Labour's 10 MEPs, displayed a sign aimed at departing British members, which read: "It's not goodbye, it's au revoir."
European Parliament President David Sassoli, also a member of the group, joined the group in a rendition of Auld Lang Syne.
On Tuesday evening, several MEPs in the Green group also held a ceremony to mark the UK's departure.
While Brexit Party MEPs spoke of their joy and relief at leaving, others shared messages of sadness on social media as they prepared to vote for the last time.
Liberal Democrats shared pictures of gifts from the pro-European Renew Europe group.
The Green Party's Alexandra Phillips tweeted: "I'm devastated to be leaving the best job in the world. I get to make real change every day while being surrounded by 27 different languages and cultures."
After the UK leaves, there will be an 11-month transition period in which the two sides hope to negotiate their future economic relationship.
Trade talks are expected to begin in earnest in early March. The European Parliament will also get a say in ratifying any future trade deal.
The UK has insisted talks should not extend beyond 31 December 2020 when a transition period - which will see the UK follow EU rules - comes to an end.
President Sassoli told CNN on Tuesday that the timetable for a deal was tight.
He said the UK's exit would be "painful" for the bloc but building a new partnership based upon friendly co-operation and mutual interests was now essential.
- BBC