After a hard-fought debate, voters in Britain decided the U.K. should leave the European Union in a historic referendum that toppled a prime minister and opened up a world of uncertainty.
With all the votes counted, the "Leave" campaign clinched victory with a more than 1 million-vote advantage. The vote was 52 percent to 48 percent in favor of leaving the union.
Prime Minister David Cameron, who brought the referendum to bear as a campaign promise and then fought hard for the Remain side, said outside his official residence on Friday that the result must be respected and that he was "proud," in spite of his loss, of the British democracy.
He admitted defeat, however, making it clear he would leave his position as Prime Minister within three months. In the U.K. it is the political party that leads the government by election, not the individual. Cameron's Conservative Party will now chose a new leader from among its ranks to take over the nation's top job.
The result -- which took even advocates by surprise -- is expected to have a dramatic impact on the global economy, and could end up changing the borders of the United Kingdom itself. Britain is a union of four nations -- England, Scotland, Wales and Northern Ireland.
Nationalists in Scotland and Northern Ireland, where residents voted decisively to remain in the EU, quickly renewed calls for separation from the United Kingdom.
It could also fuel calls for referendums on leaving the EU in other members states, leaving the future of the union that rose out of the ashes of World War II in doubt.
In Northern Ireland, the leader of nationalist party Sinn Fein said the British government had "forfeited any mandate to represent the economic or political interests" of that country.
Scottish leader Nicola Sturgeon said her country cast an "unequivocal" vote to remain in the European Union -- a result that raised the spectre of a new referendum on Scottish independence.
Sturgeon said "the vote here makes clear that the people of Scotland see their future as part of the European Union."
The world's financial markets reacted immediately, diving on Friday as word of the so-called "Brexit" rolled in.
Tokyo stocks plunged more than 7 percent and South Korea's Kospi tumbled about 4 percent. London's FTSE tumbled 8 percent, and shares in British banks lost almost a third of their value.
Crude oil prices and U.S. futures also took a big hit.
The British pound plummeted more than 10 percent in six hours while the yen surged nearly 4 percent to the U.S. dollar as investors seeking safety snapped up the Japanese currency.
The pound initially soared as polls closed and two opinion surveys put the Remain camp ahead and two leading supporters of the Leave campaign said it appeared the pro-EU side had won. But it then suffered its biggest drop in decades, plummeting from about $1.50 to $1.34 as the actual results became clear.
Cameron had said he would immediately notify the EU of Britain's intent to exit the union. Under EU rules, that will begin a maximum two-year countdown until the U.K.'s final withdrawal.
British leaders will spend those years, and likely more, renegotiating trade deals with the EU and individual countries elsewhere that are currently covered under EU membership. During the withdrawal process, Britain will remain part of the Union.
Economists said the U.K. vote to withdraw from the EU was likely to immediately hurt the British economy.
IHS slashed its forecast for 2016 GDP growth in the U.K. to 1.5 percent, down from 2 percent. The research firm also cut its growth forecast for 2017 and 2018.
"Even supporters of the 'Leave' campaign have acknowledged that there will be a near-term hit to the economy from heightened uncertainty affecting business and consumer activity, as well as from financial market turmoil," said Howard Archer, chief U.K. and European economist with IHS, in a note.
The Associated Press contributed to this report.