MEPs in Brussels voted for the agreement by 621 votes to 49, ratifying the plans which will see January 31 mark the official departure date.
There were emotional scenes in the parliament as the result was announced with MEPs linking hands to sing a final chorus of Auld Lang Syne.
In contrast, Brexit Party leader Nigel Farage was greeted by cheers and the waving of Union Flags by his party’s MEPs as he declared Britain was “never coming back”.
The EU’s chief Brexit negotiator Michel Barnier told the European Parliament: “In this new beginning I would really and sincerely like to wish the UK well.”
Referring to the referendum, he said: “Many of us here regret that decision. We continue to regret the vote, but we respect it.”
Mr Barnier added: “What we have tried to do in this treaty in an objective fashion, in a patient fashion, with all due respect, is to try and come up with responses, or legal assurances for all of those, and all sectors, where Brexit – as with a divorce – will generate insecurity and uncertainty for many citizens.
“And their rights have always been at the centre of our deliberations.”
Mr Barnier said: “We are going to continue in the year that comes, this current year with the same spirit, the same objectivity, without any aggression by firmly, however, defending the interests of the union and its member states.
“Going beyond Brexit the UK will remain there.
“It will remain a close partner when it comes to the economy. It will be an ally as it always has been and it will be a friend.”
It comes after the withdrawal agreement passed Parliament before it was formally signed by the presidents of the European Council, Charles Michel, and the European Commission, Ursula von der Leyen, in Brussels and Mr Johnson in Downing Street.
The agreement settles the terms of Britain’s departure and tees up an 11-month transition period, during which the UK will continue to follow EU rules while talks take place on a fresh agreement for trade.
It included future citizens’ rights, the arrangements on the Northern Ireland border and the UK’s divorce settlement.
In the wake of the latest vote there will be a farewell ceremony for the British MEPs leaving for the last time.
Before the vote, Brexiteer foreign secretary Dominic Raab said the decision marked a “historic moment”.
“It is the start of a new chapter for an independent, sovereign Britain, looking forward to a decade of renewal and opportunity,” he said.
“Whether we are reducing trade barriers between nations, tackling climate change, or improving lives around the world, our vision of a truly global Britain will be a force for good.”
It now sets Britain on course for crunch talks with the European Union over a future trade deal.
The PM has long insisted he will aim for free trade – though the bloc has pushed back that this will be dependent on the extent to which Britain follows EU regulations.
Brexit secretary Steve Barclay said there are not plans to diverge “for the sake of it”, though the government and particularly Brexiteers have insisted moving away from alignment was a key motivation for leaving the EU in the first place.
Britain will officially leave the EU on January 31 at 11pm GMT – with a raft of celebrations due to take place in central London.
The PM will address the nation as landmarks are lit up to mark the moment, though Big Ben will not sound as many eurosceptics had hoped.