The UK voted to leave the European Union with 52% to 48% despite London, Scotland and Northern Ireland backing staying in.
The Brexit referendum turnout was 71.8% – with more than 30 million people voting – the highest turnout at a UK-wide vote since 1992.
Nigel Farage – who has campaigned for the past 20 years for Britain to leave the EU – told cheering supporters “this will be a victory for ordinary people, for decent people”.
Germany’s foreign minister Frank Walter Steinmeier described the referendum result as “a sad day for Europe and Great Britain”.
Leave supporting Tory MP Liam Fox said voters had shown great “courage” by deciding to “change the course of history” for the UK and, he hoped, the rest of Europe.
Scotland’s First Minister Nicola Sturgeon said that the EU vote “makes clear that the people of Scotland see their future as part of the European Union” after all 32 local authority areas returned majorities for Remain.
Britain is set to be the first country to leave the EU since its formation – but the Leave vote does not immediately mean Britain ceases to be a member of the 28-nation bloc.
That process could take a minimum of two years, with Leave campaigners suggesting during the referendum campaign that it should not be completed until 2020 – the date of the next scheduled general election.
Once Article 50 has been triggered a country cannot rejoin without the consent of all member states.
UK’s PM David Cameron previously said he would trigger Article 50 as soon as possible after a Leave vote but Boris Johnson and Michael Gove who led the campaign to get Britain out of the EU have said he should not rush into it.
They also said they want to make immediate changes before the UK actually leaves the EU, such as curbing the power of EU judges and limiting the free movement of workers, potentially in breach the UK’s treaty obligations.
The UK’s government will also have to negotiate its future trading relationship with the EU and fix trade deals with non-EU countries.
In Whitehall and Westminster, there will now begin the massive task of unstitching the UK from more than 40 years of EU law, deciding which directives and regulations to keep, amend or ditch.
The Leave campaign argued during a bitter four-month referendum campaign that the only way Britain could “take back control” of its own affairs would be to leave the EU.
Leave dismissed warnings from economists and international bodies about the economic impact of Brexit as “scaremongering” by a self-serving elite.