The UK's EU referendum is proving too close to call, with Leave getting more votes than expected in early results but Remain starting to gain ground.
North-east England and Wales are backing Brexit, on a higher turnout than at the general election.
Scotland and Northern Ireland appear to have opted for Remain - but millions of votes are still to be counted in London and South-east England.
The pound surged as polls closed before falling dramatically.
Unlike at a general election the results in individual areas do not count - it is the overall number of votes cast for one side or the other across the country that will determine whether the UK leaves the European Union.
Polling expert Prof John Curtice said at this early stage Leave looked favourite to win the referendum. He estimates that the finishing post for one side to win is 16,813,000 votes.
Jenny Watson, the Electoral Commission's chief counting officer, will announce the referendum result at Manchester Town Hall after all 382 local totals have been certified and declared.
Gibraltar was the first to declare a result with 96% of voters in the British overseas territory backing Remain. A big Remain win had been predicted in Gibraltar amid concerns about its border with Spain.
Leave won by 22% in Sunderland, but Remain edged it in neighbouring Newcastle but by a tighter margin than expected, in two of the first results to declare.
According to Prof Curtice, the Remain vote is about 10% short of what was expected in north-east England and although Remain is ahead in Scotland, turnout is lower than in the rest of the UK.
Wales appears to be backing Brexit, with a vote of 54.7% for Leave so far.
Northern Ireland, with five constituencies declared so far, is voting in favour of Remain.
There are few results so far from the Midlands, Yorkshire and Humber or London and South East of England, where voting was disrupted by flash flooding, but London appears to be leaning towards Remain.
An online survey taken on polling day of 5,000 people by YouGov suggests the Remain side running at 52% of the vote, to Leave's 48%. Ipsos Mori have released polling from Thursday and Wednesday suggesting Remain will get 54% and Leave 46%.
UK Independence Party leader Nigel Farage told the Press Association the Remain camp had won based on "what I know from some of my friends in the financial markets who have done some big polling".
In a speech to supporters in London, Mr Farage - whose political career has been built on campaigning to get the UK out of the EU - said his "sense" was that the UK had voted to Remain.
He told the cheering crowd he hoped he was wrong but added: "Win or lose this battle, we will win this war, we will get this country back."
Former Labour leader Ed Miliband, who backed a Remain vote, said: "It's a nation divided and the PM will have a big responsibility - particularly if it's a Remain win - to show he understands what people are saying on the Leave side of the argument. Labour faces that responsibility too."
Several months ago, the Leave campaign didn't have much hope that they could get anywhere close in a short campaign.
They characterised themselves as the plucky underdogs, in with a shout, but certainly the real outsiders.
But, in part by using that status, indeed building a narrative of the people versus the elites, they have got themselves to a position where they might end up on the winning side.
The referendum result, which should be known by breakfast time on Friday, could be a turning point in the UK's relationship with Europe and the rest of the world.
If the UK becomes the first country to exit the EU it will arguably be the biggest blow to the 28-nation European Union since its formation.
A vote to remain would see Britain gain exemption from "ever closer" political union and other concessions secured by Prime Minister David Cameron in a renegotiation of the country's membership terms.
From 22:00 BST, there will be comprehensive coverage on the BBC News website and app with live text and video streaming, reaction and analysis from BBC editors and others. There will also be an up-to-the-minute full results service and details of all local results.
BBC One, the BBC News Channel and BBC Parliament will broadcast a results show hosted by David Dimbleby alongside BBC experts and special guests from 21:55 BST. Coverage continues through the night and Sophie Raworth, Andrew Neil and Victoria Derbyshire pick up the coverage on Friday morning.
The results programme will be streamed internationally on the BBC News website from 22:00 BST.
BBC Radio 5 live will have coverage as the results come in, as will Radio 4 from 23:00 BST until the Today programme picks up at 06:00 BST on Friday.
From 22:00 GMT, television viewers outside the UK can tune in via BBC World News and BBC World News America. Listeners outside the UK can tune into BBC World Service radio for regular updates.
Many polling stations in the South East of England reported high turnouts despite bad weather, so declarations could be later than previously expected.
There were also concerns that some commuters stranded in London because of chaos on the railways might not have got home in time to vote.
The referendum followed a bitterly-fought four month campaign, which saw Mr Cameron pitted against senior colleagues in his own party, who were campaigning for Britain to leave.
A Brexit vote could deal a fatal blow to Mr Cameron's career as prime minister, although he has vowed to stay on whatever the outcome.
Conservative MP Robert Syms says he and other Vote Leave Tories have written to Mr Cameron telling him he has a "duty" to stay on regardless of the result - the letter has been signed by all the cabinet ministers who broke ranks to back Leave, including Boris Johnson and Michael Gove.
Mr Cameron promised to hold a referendum on Britain's EU membership ahead of last year's general election, following relentless pressure from his own MPs and the UK Independence Party, which was taking votes - and later - MPs from Mr Cameron's Conservatives.
He initially suggested he would be prepared to back an out vote if he did not get what he wanted from his renegotiations.
But once the date of the referendum was announced he threw himself into the campaign for Britain to remain, arguing the country would be "stronger, safer and better-off" in the EU.
Nearly all of Britain's opposition parties, including Labour and the Scottish National Party, backed remaining in the EU, along with the majority of business leaders.
The Leave campaign - headed by former mayor of London and Conservative MP Boris Johnson - argued that the only way Britain could "take back control" of its own affairs would be to leave the EU.
The Leave campaign dismissed warnings from economists and international bodies about the economic impact of Brexit as "scaremongering" by a self-serving elite.
Immigration was a key issue in the campaign, with the Leave campaign arguing that net migration from the EU could never be reduced while the UK was signed up to free movement rules.