The United Kingdom has voted to leave the European Union after 43 years with 52% of a historic vote.
Voters in Wales and large parts of England overwhelmingly backed Brexit, fighting off Remain support in Scotland, London and Northern Ireland.
Almost three quarters (72%) of eligible voters did have their say, the highest proportion since 1992.
The BBC called the result at 04:35, with the result offically confirmed at 6am when it became mathematically impossible for Remain to win.
The Prime Minister will now invoke 'Article 50' to trigger the legal process to withdraw from the European Union. However, given that the UK will have two years to leave, it is not yet clear when Article 50 will be triggered. Many commentators have suggested the government may delay in order to buy more negotiating time.
Polls from Yougov and Ipsos Mori predicted Remain would win with 52% and 54% of the vote respectively, giving early optimism to pro-EU voters. But it soon became clear that Remain's winning margins were not as large as expected in many areas, whereas Leave exceeded expectations.
UKIP leader Nigel Farage initially conceded defeat early on, but retracting his statement and eventually lead a victory speech as early as 4am. He said 23 June would be known as 'the UK's Independence Day'.
Former shadow business secretary Chuka Umunna described the result as a "seismic moment" in our country's history.
Attention now turns to the immediate financial and political reaction to the vote to Leave, with many MPs calling for David Cameron to resign. Shortly after the polls closed, however, a letter was published containing the signatures of 82 MPs who said the Prime Minister should remain in the job regardless of the result. Michael Gove and Boris Johnson were among those, but the BBC's political editor Laura Kuenssberg believes they are already in negotiations for the departure of Mr Cameron.
The Prime Minister is expected to address the country before 9am when the financial markets open, after which we will hear from chief Brexiteers, Michael Gove and Boris Johnson.
Many predicted a Brexit would spark the break-up of the European Union. And shortly after the result of officially confirmed, the Dutch anti-EU leader Geert Wilders has said "Now it is our turn. Time for a Dutch referendum!"
Scotland's complete support for the EU has triggered speculation surrounding another Scottish independence referendum so that it may join the European Union on its own.
First Minister Nicola Sturgeon said: “While the overall result remains to be declared, the vote here makes clear that the people of Scotland see their future as part of the European Union. We await the final UK-wide result, but Scotland has spoken – and spoken decisively.”
In Northern Ireland, Sinn Fein said the referendum result 'intensifies calls for a vote on a unified Ireland'.
Has the EU referendum result impacted on your confidence in your business and the economy? Have your say in this short survey!