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.
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.”
He said some had worried the political “wrangle” would not end but it was his job to take the country forward.
Brexit parties were held in pubs and social clubs across the UK as the country counted down to its official departure.
Thousands 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.
Police in Whitehall arrested four men and also charged one man with criminal damage and being drunk and disorderly, while in Glasgow one man was arrested.
The Irish border – now the UK’s land border with the EU – was a major sticking point in the Brexit divorce talks.
NI and the Irish Republic “will continue to remain neighbours”, said NI First Minister Arlene Foster on RTÉ on Friday.
At 23:00 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.
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”.
Labour MP Hilary Benn, who chairs the Brexit select committee and backed Remain, said he was “sad last night… but we have to accept it”.
Pro-EU campaigners take part in a “Missing EU Already” rally outside the Scottish Parliament
What now? It’s happened.
A dreary night didn’t discourage those celebrating in Parliament Square. We wake this morning out of the European Union. But we follow their rules until the end of the year, without a say.
We are separate after more than 40 years, but remember much of the status quo will hold for now – the UK and the EU, the awkward couple, finally divorced – but still sharing a house and the bills.
But what the prime minister hails as a new era, a bright new dawn, starts months of hard bargaining with our neighbours across the Channel.
The UK’s requests: a free trade agreement, cooperation on security, and new arrangements for fishing are just some of the vital arguments that lie ahead.
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.
Former Brexit Secretary David Davis said agreeing a trade deal was “not a charitable exercise, this is an exercise of both sides recognising their own best interests”.