Britain is to leave the European Union after a nearly half a century plunging the country into unchartered political and economic territory and almost certainly spelling the end of David Cameron’s premiership.
With almost all the results declared voters backed Brexit by a margin of 52 to 48 per cent.
The outcome is also likely to spark a second independence referendum in Scotland that, unlike England and Wales, voted to remain in the EU.
Nicola Sturgeon said it the vote in Scotland “made clear” that it saw its future as part of the European Union.
Nigel Farage said Mr Cameron should resign “immediately”, while Labour also said that he should “consider his position”.
Markets reacted with alarm to the vote with the pound plunging against the dollar to levels not seen in more than thirty years. The FTSE was predicted to fall by around ten per cent.
One city analyst described the vote as "one of the biggest market shocks of all time".
The former Liberal Democrat leader tweeted “God help our country”. The German Finance Minister Wolfgang Schäuble said it was a “sad day for Europe”.
But Gisela Stuart, the Labour chairwoman of Vote Leave, called for calm.
“In the long run both Europe and the United Kingdom will emerge stronger as a result,” she said.
The unofficial result was confirmed just after 4.40am in the morning after a surge in support for leaving the EU confounded predictions made just hours before polls closed.
Middle England joined forces with the country’s industrial heartlands of the North East and North West to comprehensively reject warnings of economic Armageddon and vote to leave.
Support for remain was strongest in London and Scotland but with cities like Sheffield and Birmingham joining with Canterbury, Torbay and Peterborough in favour of Brexit momentum drifted away from the remain camp.
The result will now trigger a formal process of British withdrawal from the European Union. A planned meeting of European leaders next week in Brussels will now become an emergency Brexit summit.
The Ukip leader Nigel Farage claimed victory saying “dawn was breaking on an independent United Kingdom”. Provocatively he said he hoped the vote would be a catalyst for the complete collapse of the European Union.
The polling expert Professor John Curtice said Labour supporters appeared to have defied pleas from their party to support Britain’s membership of the EU – tipping the scales in favour of Brexit.
With 374 out of 382 local authority areas declared the Leave campaign had won 52 per cent of the vote compared to 48 per cent for remain. Around one million votes separated the two sides with a turnout of over seventy per cent,
“This is a seismic moment for our country,” said the former shadow Business Secretary Chuka Umunna.
“It will be catastrophic for Britain. It is just so, so terrible,” said Keith Vaz the chairman of the House of Commons Home Affairs Select Committee.
But Andrea Leadsom, the Tory Energy Minister and Vote Leave supporter said the dire predictions of economic doom did not need to come to pass.
"I think what we will now want to do is take a calm and rational look at exactly what the next steps are," she told BBC News.
"We need to reflect on what the alternatives are but at the same time to look at the possibilities of a presumption of continuity for the free trade agreements that we are already party to as a member of the EU and all of the trade negotiations both with the EU and with other countries that at the moment we are unable to trade with directly."
The result confounds a string of polls yesterday suggesting a comfortable win for remain.
A YouGov poll of 5000 people released at ten pm yesterday put Remain on 52 per cent and Leave on 48.
Senior Labour figures including Ed Miliband and Yvette Cooper suggested that the scale of support for Leave was fuelled by discontent with the way the country was heading on issues like wages, jobs and opportunities for the young.
"It's a nation divided and the PM will have a big responsibility - to show he understands what people are saying on the Leave side of the argument," said former Labour leader Mr Miliband.
"Labour faces that responsibility too. As far as Labour voters are concerned, there are two issues. There is obviously immigration, but beneath that there is a whole set of issues about people's lives and the fact that they don't feel politics is listening to them.
Shadow foreign secretary Hilary Benn told the BBC that he believed David Cameron would have to resign.
"As far as the Prime Minister is concerned I don't see how he is going to remain in his job for very long at all,” he said.
"I think it's very hard for him in those circumstances to remain. If you are the Prime Minister, you've called this referendum, you've laid your reputation on the line and your arguments, I think it's going to be very hard."
Lib Dem former Cabinet minister Sir Vince Cable described holding the referendum as a "very bad call" by the Prime Minister, who failed to understand what happens "when you just throw the cards in the air".
Shadow chancellor John McDonnell told BBC News that the Bank of England would have to intervene to prop up the pound.
"Chancellors and shadow chancellors can't comment on sterling but what we can do is have a mature approach to this and say whatever the outcome, we will negotiate the best deal we possible can with regard to our trading partners in Europe and in that way we might give some assurances to the market," he said.
Join our new commenting forum
Join thought-provoking conversations, follow other Independent readers and see their replies