The UK has officially left the European Union after 47 years of membership – and more than three years after it voted to do so in a referendum.
The historic moment, which happened at 23:00 GMT, was marked by both celebrations and anti-Brexit protests.
Candlelit vigils were held in Scotland, which voted to stay in the EU, while Brexiteers partied in London’s Parliament Square.
Boris Johnson has vowed to bring the country together and “take us forward”.
In a message released on social media an hour before the UK’s departure, the prime minister said: “For many people this is an astonishing moment of hope, a moment they thought would never come.
“And there are many of course who feel a sense of anxiety and loss.
“And then of course there is a third group – perhaps the biggest – who had started to worry that the whole political wrangle would never come to an end.
“I understand all those feelings and our job as the government – my job – is to bring this country together now and take us forward.”
Boris Johnson delivered a message to the nation on social media
He said that “for all its strengths and for all its admirable qualities, the EU has evolved over 50 years in a direction that no longer suits this country”.
“The most important thing to say tonight is that this is not an end but a beginning,” he said, and “a moment of real national renewal and change”.
Brexit supporters held a party in Parliament Square
Brexit parties were held in pubs and social clubs across the UK as the country counted down to its official departure.
Hundreds gathered in Parliament Square to celebrate Brexit, singing patriotic songs and cheering speeches from leading Brexiteers, including Nigel Farage.
The Brexit Party leader said: “Let us celebrate tonight as we have never done before.
“This is the greatest moment in the modern history of our great nation.”
Pro-EU demonstrators earlier staged a march in Whitehall to bid a “fond farewell” to the union – and anti-Brexit rallies and candlelit vigils were held in Scotland.
Other symbolic moments on a day of mixed emotions included:
The Union flag being removed from the European Union institutions in Brussels
The Cabinet meeting in Sunderland, the first city to declare in favour of Brexit when the 2016 results were announced
A pro-EU group earlier projected a message onto the White Cliffs of Dover
In Northern Ireland, the campaign group Border Communities Against Brexit staged a series of protests in Armagh, near to the border with the Irish Republic.
At 2300 GMT, Scotland’s First Minister Nicola Sturgeon tweeted a picture of the EU flag, adding: “Scotland will return to the heart of Europe as an independent country – #LeaveALightOnForScotland”.
Ms Sturgeon is calling for a new referendum on Scottish independence, arguing that Brexit is a “material change in circumstances”.
Speaking in Cardiff, Welsh First Minister Mark Drakeford said Wales, which voted to leave the EU, remained a “European nation”.
What happens now?
UK citizens will notice few immediate changes now that the country is no longer in the European Union.
Most EU laws will continue to be in force – including the free movement of people – until 31 December, when the transition period comes to an end.
The UK is aiming to sign a permanent free trade agreement with the EU, along the lines of the one the EU has with Canada.
But European leaders have warned that the UK faces a tough battle to get a deal by that deadline.
What’s the reaction in Europe?
European Commission president Ursula von der Leyen has said Britain and Brussels will fight for their interests in trade talks.
She paid tribute to UK citizens who had “contributed to the European Union and made it stronger” and said the UK’s final day in the EU was “emotional”.
Whilst never the most enthusiastic member, the UK was part of the European project for almost half a century.
On a personal level, EU leaders tell me they’ll miss having the British sense of humour and no-nonsense attitude at their table.
If they were to be brutally honest they’d have admitted they’ll mourn the loss of our not-insignificant contribution to the EU budget too.
But now we’ve left the “European family” (as Brussels insiders sometimes like to call the EU) and as trade talks begin, how long will it take for warm words to turn into gritted teeth?
French president Emmanuel Macron said: “At midnight, for the first time in 70 years, a country will leave the European Union.
“It is a historic alarm signal that must be heard in each of our countries.”
European Council President Charles Michel warned: “The more the UK will diverge from the EU standards, the less access to the single market it will have.”
What about the US?
US secretary of state Mike Pompeo said: “I am pleased the UK and EU have agreed on a Brexit deal that honours the will of the British people.
“We will continue building upon our strong, productive, and prosperous relationship with the UK as they enter this next chapter.”
Washington’s ambassador to the UK, Woody Johnson, said Brexit had been “long supported” by President Donald Trump.
America’s “special relationship” with the UK “will endure, flourish and grow even stronger in this exciting new era which Britain is now beginning,” said Mr Johnson in a statement.