Polls have closed across the United Kingdom after Britons voted on whether to quit the 28-nation European Union in a bitterly contested referendum that polarised the nation.

An early survey is suggesting voters have chosen to remain in the bloc.

The survey by pollster YouGov showed Remain ahead by a margin of 52 to 48 percent. Unlike a classic exit poll, it was based on online responses by a pre-selected sample of people rather than a survey of voters as they left polling stations.

Results are due to be announced by most of the 382 individual local counting areas between around 0000 GMT and 0300 on Friday.

The divisive referendum sparked the greatest emergency in the EU's 60-year history.

The vote pitted the Remain campaign, backed by British Prime Minister David Cameron and opposition Labour Party leader Jeremy Corbyn, against the Leave camp, led by the former London mayor, Conservative MP Boris Johnson.

Brexit Q&A: All you need to know

The "Remain" camp predicts economic doom if Britain leaves the EU while the "Leave" campaign warns of the perils of uncontrolled immigration unless Britain strikes out on its own.

'Out is out'

EU leaders warned there would be no turning back from a vote to quit the 28-member bloc.

"Out is out," European Commission chief Jean-Claude Juncker said in Brussels, dismissing any chances of a post-vote re-negotiation of Britain’s EU membership terms.

The referendum has raised concerns across Europe that a British withdrawal could trigger a domino effect of exit votes and threaten the integrity of the bloc, already under severe strain from Eurozone and migration crises.

Even if it stays, the status quo will not be an option.

"Whatever the result is going to be, we must take a long hard look at the future of the union. We would be foolish if we ignored such a warning signal as the UK referendum," EU President Donald Tusk warned this week.

Tusk has previously said that a British leave vote could lead to the "destruction of not only the EU but also of Western political civilisation".

The EU was created after the Second World War as an antidote to the nationalism which had devastated the continent. The movement for unity was led by France and Germany.

Q&A: All you need to know about the EU Referendum

EU referendum: Has UK politics ever been so ugly?

Here's why Brexit matters to GCC countries

Is the European Union still attractive?

Brexit and the spectre of Europe's ugly nationalism

The UK, EU and Brexit: Who wins and who loses?

Brexit: UKIP's 'unethical' anti-immigration poster

Brexit and Boris Johnson: A perfect political pairing?

Beyond the Brexit debate

Jo Cox killing: Has politics in the UK become too divisive and toxic?

Brexit: Making Britain great again?

Is Brexit driven by the fear of migrants?