In a political earthquake, voters in Britain have apparently chosen to pull their country out of the European Union, throwing their economy into doubt, leaving their government in disarray and unleashing consequences that will take months, if not years, to shake out.

With a majority of the votes counted, British media called the result of the historic "in or out" referendum shortly after 4:30 a.m. Friday, local time, forecasting about a 52% to 48% decision in favor of ripping up Britain's membership card in the 28-nation trading bloc. It was an astonishing outcome and a stunning rebuke of the E.U., which is now faced with the unprecedented situation of a nation quitting the club instead of clamoring to get in.

The election result was called by the BBC and other news outlets before a nation bitterly divided between those who believe their prosperity and security lie in European cooperation and those who say Britain needs to regain control over its destiny and its borders. Turnout among the more than 46 million eligible voters was high, hovering around 70%.

Those in the "Leave" camp ignored pleas from the heads of Britain's two major parties, Nobel Prize-winning economists, military officials, industry executives and leaders of nearly all of the country's closest allies, including the United States, to stay in the European Union.

"The dawn is breaking on an independent United Kingdom," declared Nigel Farage, the leader of the U.K. Independence Party, which opposes British membership in the E.U. Farage called the outcome a victory over big politics, big banks and multinationals in favor of "honesty, decency and belief in nation."

International markets were not so sanguine. The British pound, which had rallied after misleading indications of a win for the "Remain" side, plummeted in value, touching its lowest level against the dollar in 30 years.

Whether there will be worse immediate fallout is unclear.

Regardless, Britain faces a long period of uncertainty as it tries to undo more than 40 years of membership in the E.U., disentangling British laws from Europe-wide statutes and re-negotiating countless trade agreements, including with the European partners it has now jilted. It remains to be seen whether the E.U. will treat Britain harshly to discourage other member states from following it out the door, or adopts a conciliatory attitude to keep relations on a good footing.

The fate of Prime Minister David Cameron, who had called the referendum under pressure from his Conservative Party backbenchers but campaigned to remain in the E.U., was also unclear in the immediate aftermath. Some political analysts say he is likely to resign following a defeat on such a monumental issue, setting off a scramble for his job.

Voters cast their ballots Thursday after weeks of increasingly acrimonious debate, as each side accused the other of lying or fear-mongering. The "Leave" camp warned of unchecked immigration if Britain stayed in the E.U., using rhetoric that critics said smacked of racism and xenophobia, while "Remain" advocates predicted complete economic collapse if Britain quit the club.

The atmosphere was further shaken up with the killing last week of a member of Parliament, Jo Cox, who police say was stabbed and shot by a man suspected of links to far-right groups. Cox was a strong supporter of continued British membership in the E.U.

The "Remain" side began the campaign months ago with a strong lead, but watched that advantage wither under constant hammering by opponents who claimed that E.U. membership cost Britain far more than it gained, that European migrants took jobs away from locals and that Turkey would soon join the E.U. and send millions of Muslims to Britain. Pro-"Leave" voters were unmoved by the vast weight of expert opinion that Britain was better off inside the E.U. and by the pleas of President Obama and other friendly leaders to stay.

Polls showed younger people in favor of sticking with the European Union and older voters in favor of ditching it. The "Remain" camp also tended to do better in large urban areas, whereas provincial areas opted to get out of the E.U., laying bare the stark - and growing - divisions between different parts of the country.

London, Britain's capital and its biggest, richest and most cosmopolitan city, voted strongly to stay in. The entertainment industry, centered in London, largely reflected that sentiment.

Scotland also voted by a large majority to remain in the E.U. The fact that the rest of Britain opted to leave is likely to fuel calls for a new vote on Scottish independence.