By Guy Faulconbridge and Kate Holton
LONDON (Reuters) - Britain voted to leave the European Union, forcing the resignation of Prime Minister David Cameron and dealing the biggest blow to the European project of greater unity since World War Two.
Global financial markets plunged on Friday as results from a referendum showed a near 52-48 percent split for leaving a bloc that Britain joined more than 40 years ago.
The pound fell as much as 10 percent against the dollar to touch levels last seen in 1985, on fears the decision could hit investment in the world's fifth-largest economy, threaten London's role as a global financial capital and usher in months of political uncertainty.
World stocks headed for one of the biggest slumps on record, and billions of dollars were wiped off the value of European companies. Britain's big banks took a $130 billion battering, with Lloyds and Barclays falling as much as 30 percent at the opening of trade.
The United Kingdom itself could now break apart, with the leader of Scotland - where nearly two-thirds of voters wanted to stay in the EU - saying a new referendum on independence from the rest of Britain was "highly likely".
An emotional Cameron, who led the "Remain" campaign to defeat, losing the gamble he took when he called the referendum three years ago, said he would leave office by October.
"The British people have made the very clear decision to take a different path and as such I think the country requires fresh leadership to take it in this direction," he said in a televised address outside his residence.
"I do not think it would be right for me to be the captain that steers our country to its next destination," he added, appearing to choke back tears before walking back through the black door of No. 10 Downing Street with his arm around his wife Samantha.
Quitting the EU could cost Britain access to the EU's trade barrier-free single market and means it must seek new trade accords with countries around the world.
The EU for its part will be economically and politically damaged, facing the departure not only of its most free-market proponent but also a member with a U.N. Security Council veto, a powerful army and nuclear capability. In one go, the bloc will lose around a sixth of its economic output.
"It's an explosive shock. At stake is the break up pure and simple of the union," French Prime Minister Manuel Valls said. "Now is the time to invent another Europe."
The result emboldened eurosceptics in other member states, with populist leaders in France and the Netherlands demanding their own referendums to leave.
The vote will initiate at least two years of divorce proceedings with the EU, the first exit by any member state. Cameron - who has been premier for six years and called the referendum in a bid to head off pressure from domestic eurosceptics - said it would be up to his successor to formally start the exit process.
His Conservative Party rival Boris Johnson, the former London mayor who became the most recognisable face of the "Leave" camp, is now widely tipped to seek his job.
Johnson left his home to jeers from a crowd in the mainly pro-EU capital. He spoke to reporters at Leave campaign headquarters, taking no questions on his personal ambitions.
"We can find our voice in the world again, a voice that is commensurate with the fifth-biggest economy on Earth," he said.
There was euphoria among Britain's eurosceptic forces, claiming a victory over the political establishment, big business and foreign leaders including U.S. President Barack Obama who had urged Britain to stay in.
"Dare to dream that the dawn is breaking on an independent United Kingdom," said Nigel Farage, leader of the eurosceptic UK Independence Party, describing the EU as "doomed" and "dying".
"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."
European politicians reacted with dismay.
"It looks like a sad day for Europe and Britain," said German foreign minister Frank-Walter Steinmeier.
"Please tell me I'm still sleeping and this is all just a bad nightmare!" former Finnish Prime Minister Alexander Stubb tweeted.
The shock hits a European bloc already reeling from a euro zone debt crisis, unprecedented mass migration and confrontation with Russia over Ukraine. Anti-immigrant and anti-EU political parties have been surging across the continent, loosening the grip of the centre-left and centre-right establishment parties that have governed Europe for generations.
French National Front leader Marine Le Pen called for a similar referendum in France, changed her Twitter profile picture to a Union Jack and declared "Victory for freedom!"
Dutch far right leader Geert Wilders, also demanding a referendum, said: "We want be in charge of our own country, our own money, our own borders, and our own immigration policy."
U.S. presidential candidate Donald Trump, whose own rise has been fuelled by similar disenchantment with the political establishment, called the vote a "great thing". Britons "took back control of their country", he said in Scotland where he was opening a golf resort.
Britain has always been ambivalent about its relations with the rest of post-war Europe. A firm supporter of free trade, tearing down internal economic barriers and expanding the EU to take in ex-communist eastern states, it opted out of joining the euro single currency or the Schengen border-free zone.
Cameron's ruling Conservatives in particular have harboured a vocal anti-EU wing for generations, and it was partly to silence such figures that he called the referendum in 2013.
World leaders including Obama, Chinese President Xi Jinping, German Chancellor Angela Merkel, NATO and Commonwealth governments had all urged a "Remain" vote, saying Britain would be stronger and more influential in the EU than outside.
The four-month campaign was among the divisive ever waged in Britain, with accusations of lying and scare-mongering on both sides and rows on immigration which critics said at times unleashed overt racism.
It revealed deep splits in British society, with the pro-Brexit side drawing support from millions of voters who felt left behind by globalisation and believed they saw no benefits from Britain's ethnic diversity and free-market economy.
At the darkest hour, a pro-EU member of parliament was stabbed and shot to death in the street. The suspect later told a court his name was "Death to traitors, freedom for Britain".
Older voters backed Brexit; the young mainly wanted to stay in. London and Scotland supported the EU, but wide swathes of middle England, which have not shared in the capital's prosperity, voted to leave.
Concerns over uncontrolled immigration, loss of sovereignty and remote rule from Brussels appear to have trumped almost unanimous warnings of the economic perils of going it alone.
THREAT OF UK BREAK-UP
The United Kingdom itself now faces a threat to its survival. Scottish First Minister Nicola Sturgeon said it was "democratically unacceptable" for Scotland to be dragged out of the EU against its will.
"It is a statement of the obvious that the option of a second referendum must be on the table and it is on the table," she told reporters, two years after Scots voted to stay in the United Kingdom. "I think an independence referendum is now highly likely."
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.
The global financial turmoil was the worst shock since the 2008 economic crisis, and comes at a time when interest rates around the world are already at or near zero, leaving policymakers without the usual tools to respond.
The body blow to global confidence could prevent the Federal Reserve from raising interest rates as planned this year, and might even provoke a new round of emergency policy easing from all major central banks, despite their limited options.
The Bank of England pledged a huge financial backstop to calm plunging markets. Governor Mark Carney said it was offering to provide more than 250 billion pounds ($347 billion) plus "substantial" foreign currency liquidity and it was ready to take additional measures if needed.
Other central banks around the globe also intervened in markets. The European Central Bank said it was ready to provide euro and foreign currency liquidity if necessary.
EU affairs ministers and ambassadors from member states gather in Luxembourg by 10 a.m. (0800 GMT) for previously-scheduled talks that will provide the first chance for many to react.
Left unclear is the relationship Britain can negotiate with the EU once it leaves.
To retain access to the single market, vital for its giant financial services sector, London may have to adopt all EU regulation without having a say in its shaping, contribute to Brussels coffers, and continue to allow free movement as Norway and Switzerland do - all things the Leave campaign vowed to end.
EU officials have said UK-based banks and financial firms would lose automatic "passport" access to sell services across Europe if Britain ceased to apply the EU principles of free movement of goods, capital, services and people.
Aside from trade, huge questions now face the millions of British expatriates who live freely elsewhere in the bloc and enjoy equal access to health and other benefits, as well as millions of EU citizens who live and work in Britain.
(Additional reporting by William James, Kylie MacLellan, Sarah Young, Alistair Smout, Costas Pitas, Andy Bruce and David Milliken; Writing by Mark John and Pravin Char; Editing by Peter Graff)