A pro-Europe supporter holds up a sign during a rally in London on Wednesday. (Matt Dunham/AP)

Britain careened toward a historic choice Wednesday as voters heard final pitches on both sides of a bitterly fought referendum showdown that could rock the global economy and deeply unsettle the Western political order.

After months of campaigning that sharply divided the country over questions of immigration and identity, final polls showed Britons almost exactly split over whether the country should exit the 28-member European Union.

Voting takes place Thursday, and the results are expected early Friday (Thursday evening Eastern time.)

Although “leave” had been leading the polls recently, “remain” has caught up since pro-E.U. member of Parliament Jo Cox was fatally shot and stabbed last week, jolting the country and prompting calls for an end to some of the campaign’s more hateful rhetoric.

On June 23, Britain faces a fateful decision: whether or not to leave the European Union. And the world will be watching. (Daron Taylor,Jason Aldag,Danielle Kunitz/The Washington Post)

The referendum marks an existential decision that could dramatically reshape Britain’s global role in a way not seen since London shed its empire after World War II. It could also lead to another push on Scottish secession, the further unraveling of the European Union and the fall of Prime Minister David Cameron’s government.

Advocates for a British exit — popularly known as Brexit — argue that tossing off the shackles of E.U. bureaucracy will restore Britain’s sovereignty. A powerful selling point for many votes is the claim that a farewell to E.U. ties could give the country the latitude to dramatically reduce immigration, which has hit record highs as Poles, Hungarians, Romanians and others from across Europe have flocked to the relative prosperity of the British economy.

“I really think tomorrow can be independence day,” former London mayor Boris Johnson told supporters Wednesday as he posed for photos with fishmongers and waved copies of the virulently anti-E.U. Sun newspaper.

But opponents say a vote to leave could be a grievous ­self-inflicted wound from which it would take years, if not decades, for Britain to recover.

“We don’t solve our immigration challenge by leaving the European Union, but we do create a massive problem for our economy,” Cameron told the BBC on the eve of the vote. “This is irreversible. You can’t jump out of the airplane then climb back in through the cockpit hatch.”

Most economic, political and defense authorities — including nearly all foreign leaders — have joined the call for Britain to stay, and they have issued dire warnings about the consequences of Brexit.

Supporters hold banners as former London mayor Boris Johnson attends a "Vote Leave" rally in Selby, England, on Wednesday. (Ed Sykes/Reuters)

Economic forecasters have said a British break could push the country back into recession, with the rest of the globe vulnerable to the ripples. Many geopolitical strategists also warn that a vote to leave could divide the Western alliance and be a boon to others such as Russian President Vladimir Putin.

But many of the 46 million Britons eligible to vote have paid little heed, with surveys showing that anxiety over immigration is trumping all other voter concerns.

The “leave” campaign has played on those fears, arguing — with little supporting evidence — that Turkey will soon join the European Union and intensify the flood of migrant workers arriving on British shores under the bloc’s free-movement rules.

It has also dismissed warnings from independent experts as part of an elitist plot, what it terms “Project Fear.”

Two of the top Brexit campaigners — Johnson and Justice Secretary Michael Gove — have invoked provocative Nazi comparisons. Johnson has suggested that E.U. ambitions mirror those of Hitler’s Germany, and Gove has painted Brexit critics as akin to Nazi propagandists who sought to discredit Albert Einstein.

The “remain” side has returned fire in recent days.

London Mayor Sadiq Khan castigated the anti-E.U. camp’s anti-immigrant message as “Project Hate.” Meanwhile, former prime minister John Major on Wednesday called Johnson and Gove, both fellow Conservatives, “gravediggers of our prosperity.”

Another former prime minister, Gordon Brown, decried the overall tone of a debate that has been marked by xenophobia and nativism. “This is not the Britain I know,” he said.

Whichever side wins Thursday will have to reckon with the profound and emotional schisms in British society that have come to the surface during the campaign.

When Cameron promised a referendum in January 2013, he had hoped the vote would put to rest a debate over Europe that has bedeviled Britain for decades and that has generated particularly deep fault lines in his Conservative Party.

Instead, the campaign appears only to have made those divisions worse, while also layering the debate with the added complexity of personal ambition. Several prominent campaigners — especially Johnson — are thought to be jockeying for Cameron’s job if the country defies the prime minister and votes for an exit.

Even if “remain” wins, Britain’s angst is unlikely to be resolved. Some “leave” campaigners have said they will press for another referendum if they come up short in a close vote.

Thursday’s vote also has the potential to reawaken another fundamental question of British identity. Scottish leaders say that if Britain votes to leave the European Union against the will of the pro-European Scots, they will renew their push for independence just two years after losing a referendum vote.

The outcome will be watched closely in capitals around the globe. President Obama has weighed in strongly for the “remain” side, saying he thinks Britain is a more valuable ally from within the European Union.

All of Britain’s E.U. allies have said they, too, want Britain to stay. To illustrate the point, European landmarks from Paris to Warsaw have been bathed in the colors of the Union Jack this week, along with the message “Vote Remain.”

In an op-ed in Britain’s Guardian newspaper Wednesday morning, Italian Prime Minister Matteo Renzi wrote that a vote to leave would be “the wrong choice.”

“It would be a mistake for which you, the voters, primarily would pay the price,” he wrote. “Because who really wants Britain to be small and isolated?”

European allies also have their own interests to protect. If Britain leaves, it could set off a chain reaction of defections and attempted defections across the continent as Euroskepticism surges.

This is all unknown territory for the European Union, which has steadily expanded over past decades.

Under E.U. rules, a departing member has two years to negotiate the terms of its exit. But, in reality, most experts think that the divorce proceedings would last far longer and that Brussels-based negotiators would have little incentive to give Britain a good deal.

Cameron on Wednesday warned voters not to allow Britain to be downgraded from a place at the table to press for British interests in Europe, and instead wind up “standing outside, ear pressed to the glass.”

But in the febrile environment of British politics, it was not clear that voters would care whether they have a voice in the European Union, an organization that inspires little love even among “remain” backers.

In his final speech of the campaign, pro-leave firebrand Nigel Farage said Wednesday that the vote was a chance to liberate the country from European bureaucrats and other continental elites.

“This referendum,” said Farage, head of the U.K. Independence Party, “is about the people versus the establishment.”

And that’s what worried Cay Schroder, 72, a painter who was in Trafalgar Square late Wednesday afternoon along with thousands of others for an emotional memorial to Cox on what would have been her 42nd birthday. The event featured a speech from Nobel laureate Malala Yousafzai of Pakistan, a video message from Irish rock star Bono and a school choir featuring the classmates of Cox’s young son.

The crowd was heavily for “in,” but Schroder said he knew that was deceptive.

“I’ve been campaigning for a fortnight, and I think London is mainly in and the rest of the country is mainly out,” said Schroder, who proudly sported a “Remain” T-shirt.

Young voters, he said, were “in” but may not vote. The “out” voters were older, and determined to recover a bygone time for Britain that cannot be re-created.

“They long for something,” he said, “that doesn’t exist anymore.”

Karla Adam contributed to this report.

Read More:

Analysis: Would break from Brussels also splinter Britain? Probably not.

Why North America won’t copy European unity