Britain's moment of truth is fast approaching. On Thursday, the country will vote on whether to remain in or to leave the European Union. The referendum has generated a torrent of analyses, commentaries and appeals — including President Obama's urging Britain to stay in. Most serious studies have concluded that Britain would be economically and politically damaged by "Brexit," a British exit from the E.U.

And yet the chorus of disgruntled voters convinced that bureaucrats in Brussels are threatening their identity, sovereignty and values — and packing their island with foreigners — is growing by the day. This British version of "make America great again" is every bit as illusory as Donald Trump's slogan — and just as potentially dangerous, for Britain and for its European and North American partners. The campaign has generated powerful emotions. Last week, after the shooting death of Jo Cox, a Labour Party politician who has been a strong voice for staying in the union, both sides suspended all campaigning.

There would be concrete consequences for Britain if it severs itself from the E.U. It would lose tariff-free access to its largest trading market or be forced to make big concessions. It would have to negotiate its own trade pacts with other nations, with much less bargaining heft. The anti-union crowd promises that freedom from E.U. regulation would bring economic gains, but Britons would have to write their own protections — in areas from the environment to banking.

Indeed, the E.U. is flawed. Its dysfunction has been on display in its fitful handling of the Greek debt and refugee crises, its bureaucracy is pathetically slow to recognize or correct its failings, and it often acts like an undemocratic elite. Part of that is the inherent inefficiency of an institution of 28 member states with big differences in size, wealth and democratic traditions, and which participate to different degrees in the single currency and border-free zone.

Yet the E.U. is an extraordinary achievement, a voluntary union of nations whose histories include some of the bloodiest wars ever waged. However flawed, the bloc has replaced blood feuds with a single market, shared values, free travel and labor mobility. Britain always has been something of an outlier, joining what began as the European Coal and Steel Community two decades after it was formed and declining to participate in either the euro currency or the borderless Schengen zone. Yet Britain has benefited from membership, both economically and as a strong voice in shaping E.U. policy.

The euroskepticism that has led to the referendum — and that forms a strong component of the right-wing nationalist parties on the rise in Europe — is not about efficiency or history. It is about ill-defined frustration with the complexities of a changing world and a changing Europe, a loss of faith in mainstream politicians and experts, and a nostalgia for a past when nations decided their own fates and kept foreigners out. To those who hold these views, the E.U. is the epitome of all that has gone wrong. Not surprisingly, Trump and the French politician Marine Le Pen both favor Brexit.

But there is no turning back the clock, and an exit could create new problems at home — like a Scotland that would break with Britain in order to stay in the E.U. Apart from the financial chaos and damage it would do to Britain, a vote to leave would encourage euroskeptics across the Continent, putting the entire European project at risk. Britain's exit, in short, would be a disaster. The hope at this stage rests on the Britons who understand what is at stake. Every one of their votes is critical Thursday.

FROM AN EDITORIAL IN THE NEW YORK TIMES