Britain has voted to leave the European Union, results from Thursday's landmark referendum showed, an outcome that sets the country on an uncertain path and deals the largest setback to European efforts to forge greater unity since World War Two.
World financial markets dived as nearly complete results showed a 51.8/48.2 percent split for leaving. Sterling suffered its biggest one-day fall of more than 10 percent against the dollar, hitting a 31-year low on market fears the decision will hit investment in the world's 5th largest economy.
The vote will initiate at least two years of messy divorce proceedings with the EU, raise questions over London's role as a global financial capital and put huge pressure on Prime Minister David Cameron to resign, though he pledged during the campaign to stay on whatever the result.
The euro slumped more than 3 percent against the dollar on concerns a Brexit vote will do wider economic and political damage to what will become a 27-member union. Investors poured into safe-haven assets including gold, and the yen surged. European shares were on course to open 6 to 7.5 percent lower.
There was no immediate comment from the Bank of England. Global policymakers prepared for action to stabilise markets, with Japanese Finance Minister Taro Aso promising to "respond as needed" in the currency market.
Yet there was euphoria among Britain's eurosceptic forces, claiming a victory they styled as a protest against British political leaders, big business and foreign leaders including Barack Obama who had urged Britain to stay in the bloc.
"Dare to dream that the dawn is breaking on an independent United Kingdom," said Nigel Farage, leader of the eurosceptic UK Independence Party.
"If the predictions are right, this will be a victory for real people, a victory for ordinary people, a victory for decent people ... Let June 23 go down in our history as our independence day."
He called the EU a "doomed project".
By 5.41 a.m. (0441 GMT), 93 percent of the vote had been counted, making Leave's lead impossible to reverse.
Asked if Cameron, who called the referendum in 2013 and campaigned to stay in the bloc, should resign if Britain voted for Brexit, Farage said: "Immediately."
An aide working in Cameron's office told reporters: "We're in uncharted territory... Everyone's just really tired. They haven't slept."
The United Kingdom itself now faces a threat to its survival, as Scotland voted 62 percent in favour of staying in the EU and is likely to press for a new referendum on whether to become independent after its 2014 vote to stay in the UK.
Scottish First Minister Nicola Sturgeon said Thursday's vote "makes clear that the people of Scotland see their future as part of the European Union."
Northern Ireland's largest Irish nationalist party, Sinn Fein, said the result intensified the case for a vote on whether to quit the United Kingdom.
European politicians reacted with shock. "Please tell me I'm still sleeping and this is all just a bad nightmare!" former Finnish Prime Minister Alexander Stubb tweeted.
Quitting the EU could cost Britain access to the EU's trade barrier-free single market and mean it must seek new trade accords with countries around the world. President Barack Obama says it would be at the "back of a queue" for a U.S. pact.
The EU for its part will emerge economically and politically weakened, facing the departure not only of its most free-market proponent but also a member country that wields a U.N. Security Council veto and runs a powerful army. In one go, the bloc will lose around a sixth of its total economic output.
Cameron is expected to formally report the result to his European counterparts within days and prepare negotiations for the first exit by a member state from the EU -- an exit he has said would be irreversible.
The British leader called the referendum in 2013 in a bid to head off pressure from local eurosceptics, including within his own party. Initially billed as an easy ride, the vote has now put his political future on the line. Party ally Boris Johnson, the former London mayor who became the most recognizable face of the "leave" camp, is now widely tipped to seek his job.
Opinion polls had see-sawed throughout an acrimonious four-month campaign, but the Remain camp edged ahead last week after a pro-EU member of parliament, Jo Cox, was shot and stabbed to death by a man shouting "Britain first". The attack shocked Britons and raised questions about whether the tone of the debate was fuelling intolerance and hatred.
In the end though, the pro-EU camp was powerless to stop a tide of anti-establishment feeling and disenchantment with a Europe that many Britons see as remote, bureaucratic and mired in permanent crises.