Brexit: Britain votes to leave the European Union after tight and bitter campaign
* Leave vote leads 51.8 per cent to Remain's 48.2 per cent
* Turnout UK-wide was 72 per cent.
* No independent EU country has ever left the bloc until now
* British pound tumbles to a 31-year low
* UK Independence Party leader Nigel Farage: "Dawn is breaking on an independent United Kingdom."
* Analysts say anti-EU sentiment is running unexpectedly strong in northern English cities hits hard hit by industrial decline and job losses, with broad swathes of England and Wales recording "leave" majorities
* Northern Ireland and Scotland voted to remain, Wales voted to leave
The "leave" campaign has won a nail-biting decision on the UK's future in the European Union.
With all results declared, those in favour of ending Britain's 43-year membership were on 51.8 per cent of the vote, with 17,410,742 votes. Remain has 16,141,241. Turnour across the UK was 72 per cent.
The British pound soared after two leading supporters of the "leave" campaign said it appeared the pro-EU side had won, then plummeted as Britain's first few counting areas reported their results. The stage was set for a nerve-wracking night of ballot-counting after a day of high turnout and foul weather.
UKIP's Nigel Farage said: "Dare to dream that the dawn is breaking on an independent United Kingdom."
A spokesperson for the New Zealand Prime Minister John Key said: '
"This was always a decision for voters in the UK and we respect the decision they have made.
"We will continue to have a strong relationship with both the EU and the UK, and to further develop our ties with both. In this respect nothing has changed.
"The UK remains a member of the EU for the moment and it will take some time to work through the implications of their decision to leave.
"In terms of our existing trade arrangements, the immediate effects of the leave vote on New Zealand are likely to be limited and we expect that trade and other business activities will continue smoothly in the interim.
"We remain committed to the launch of formal negotiations on an EU FTA, and will be working with the UK as they go through the process of leaving the EU to put in place new trading arrangements."
As "leave" votes pour in from Britain's historic vote on European Union membership, post-mortems are already being produced. One expert says the "remain" side had suffered from "a degree of complacency."
Tim Oliver, a fellow at the London School of Economics' IDEAS foreign policy think tank says "the campaign failed to connect to ordinary people, seemed too much of an elite and London-based one."
Oliver says the vote wasn't just about Europe - but also about a popular British backlash against the capital and its elites. He says "the EU was one of the things kicked by this, but there were lots of other things such as a general anti-establishment feeling, anti-London feeling."
The first results, from England's working-class northeast, were a smaller-than-expected "remain" win of 50.7 percent in Newcastle and a bigger-than-expected "leave" vote of 61 per cent in nearby Sunderland.
A vote to leave the EU would destabilize the 28-nation trading bloc, created from the ashes of World War II to keep the peace in Europe. A "remain" vote would nonetheless leave Britain divided and the EU scrambling to reform.
As the polls closed, UK Independence Party leader Nigel Farage set a downbeat tone for the supporters of a British exit - or Brexit - from the EU, telling Sky News television "it looks like 'remain' will edge it" in the referendum.
But he walked back those comments in later, telling reporters at a "leave" party in central London that "maybe just under half, maybe just over half of the country" had voted to pull Britain out of the EU."
Pollster Ipsos MORI said a survey conducted on Wednesday and Thursday suggested the "remain" side would win Britain's EU referendum by a margin of 54 per cent to 46 per cent.
Earlier Thursday, the firm had released a poll that indicated a 52-48 victory for "remain." That phone poll of 1,592 people had a margin of error of plus or minus three percentage points. But the firm's chief executive, Ben Page, said continued polling on Thursday suggested a bigger swing to "remain" that gave the 54-46 result.
The overseas territory of Gibraltar was the first to report results, and as expected the British enclave reported an overwhelming vote for "remain" - 96 per cent.
There as elsewhere, turnout appeared high. Officials in Gibraltar said almost 84 per cent of eligible voters turned out to cast ballots; witnesses and reporters elsewhere said turnout was higher than in last year's general election, which was 66 per cent.
High turnout is expected to boost the "remain" vote, because "leave" supporters are thought to be more motivated. But high turnout in working-class areas that typically have lower tallies could also boost the "leave" vote.
* 'Out is out,' European Union chief warns Britain ahead of Brexit vote
* 'In' camp's lead cut to just one point
* 'Brits don't quit' says PM Cameron
* Cameron warns 'Leave' to divide
* Jo Cox's killing complicates Brexit
* Brexit explained: The choice Britain faces
* Brexit and the illusion of more British sovereignty
"I think it is going to be really close," said photographer Antony Crolla, 49, outside a London polling station.
"Leave" campaigners claim that only a vote to leave can restore power to Parliament and control immigration. The "remain" campaign, led by Prime Minister David Cameron, argues that Britain is safer and richer inside the EU.
Polls had for months suggested a close battle, although the past few days have seen some indication of momentum swinging toward the "remain" side.
Torrential rains, especially in the "remain" stronghold of London, raised fears of diminished turnout. London's Fire Brigade took 550 weather-related calls as the capital was hit by heavy rain, thunderstorms and lightning strikes. Some polling stations were forced to close because of flooding.
HOW BREXIT CAME ABOUT
Prime Minister David Cameron called the vote under pressure from the anti-EU wing of his Conservative Party and the surging UK Independence Party (UKIP), hoping to end decades of debate over Britain's ties with Europe.
The "Leave" campaign says Britain's economy would benefit from an exit from the EU, or Brexit. Cameron says it would cause financial chaos and impoverish the nation.
He voted early, and said on Twitter: "Vote Remain - so that our children and grandchildren have a brighter future."
His main rival, former London mayor Boris Johnson, whose decision to support 'Leave' galvanised its campaign, told voters on Wednesday this was the "last chance to sort this out".
It is only the third referendum in British history. The first, also about membership of what was then called the European Economic Community, was in 1975.
The four-month campaign, which has exposed bitter divisions in the ruling Conservative Party, was dominated by immigration and the economy, and shaken by the murder of pro-EU Labour lawmaker Jo Cox last week.
The killing of Cox, a 41-year-old mother of two young children, in her electoral district in northern England prompted a pause in the campaign and soul-searching about its tone. Cox's husband said she had been concerned about the coarsening of political dialogue.
The man charged with her murder, asked to confirm his name in a London court, responded: "My name is death to traitors, freedom for Britain".
Britain is deeply divided on EU membership, with big differences between older and younger voters, and between pro-EU London and Scotland and eurosceptic middle England.
That split was reflected in British newspapers' front pages. "Independence Day" was the front page headline of the Sun tabloid, Britain's biggest-selling newspaper, while the Daily Mirror warned "Don't take a leap into the dark".
The issue also dominated news bulletins far beyond Britain. In China, the Global Times, published by the ruling Communist Party's official People's Daily, warned Britain would lose its influence globally if voters backed Brexit.
Whatever the outcome of the vote, the focus on immigration to Britain, which has increased significantly in recent years, could worsen frictions in a country where the gap between rich and poor has also been widening.
If Britons choose to leave, Scottish leader Nicola Sturgeon has suggested Scotland may call a referendum on leaving the United Kingdom.
Even with a vote to stay, Cameron could struggle to repair the rifts in his party and hold on to his job.
Foreign leaders, from US President Barack Obama to Chinese leader Xi Jinping, have called on Britain to remain in the EU, a message supported by global financial organisations, many company bosses and central bankers.
International banks have warned that the value of the pound could fall dramatically if Britain votes to leave and traders expect markets to be more volatile than at any time since the 2008-09 financial crisis.
The "Out" campaign says a fall in the value of the pound would boost exports and has found support among some financial specialists and small businesses. It has urged voters to ignore what it calls the "establishment" which it says has the most to lose from Brexit.
The EU has struggled with migration and economic crises and a Brexit vote would boost opposition to it within other member states.
"Stay with us," European Council President Donald Tusk told British voters on Monday.
"Without you, not only Europe, but the whole Western community will become weaker. Together, we will be able to cope with increasingly difficult challenges of the future."
*Comments have now closed on this story*