Boris Johnson has signed the Brexit withdrawal agreement in Downing Street.
The prime minister hailed a "fantastic moment" for the country after he put his name to the historic agreement, which paves the way for the UK's exit from the European Union next Friday.
He said he hoped it would "bring to an end far too many years of argument and division".
Earlier on Friday, European leaders signed the document in Brussels, before it was transported to London by train.
The signings mark another step in the ratification process, following Parliament's approval of the Brexit bill earlier this week. The European Parliament will vote on the agreement on 29 January.
Downing Street officials said the PM marked the document with a Parker fountain pen, as is traditional for ceremonial signings in No 10.
It was witnessed by EU and Foreign Office officials, including the PM's Chief Negotiator David Frost, and Downing Street staff.
"The signing is a fantastic moment, which finally delivers the result of the 2016 referendum and brings to an end far too many years of argument and division," Mr Johnson said.
"We can now move forward as one country - with a government focused upon delivering better public services, greater opportunity and unleashing the potential of every corner of our brilliant UK, while building a strong new relationship with the EU as friends and sovereign equals."
Today I have signed the Withdrawal Agreement for the UK to leave the EU on January 31st, honouring the democratic mandate of the British people.— Boris Johnson (@BorisJohnson) January 24, 2020
This signature heralds a new chapter in our nation’s history. pic.twitter.com/IaGTeeL2is
Earlier on Friday, the document crossed the channel on a Eurostar train, having been signed in Brussels by the European Council's president Charles Michel and the European Commission president Ursula von der Leyen.
The UK will keep a copy of the agreement while the original will return to Brussels, where it will be stored in an archive along with other historic international agreements.
Next week's European Parliament vote is seen as all but a formality, after it was backed by the parliament's constitutional affairs committee on Thursday.
Mrs von der Leyen and other senior EU figures are sceptical about the UK government's plan to negotiate a comprehensive deal on future relations before the end of 2020. They believe the timetable for that is too tight.
But Prime Minister Boris Johnson is upbeat, insisting the UK can now move forward after years of wrangling over Brexit.
Mr Michel, the former Belgian Prime Minister who chairs EU summits, said in a tweet: "Things will inevitably change but our friendship will remain. We start a new chapter as partners and allies."