Live EU vote results from every referendum count in Northern Ireland, Scotland, Wales and England - Boris Johnson and Michael Gove urge Cameron to remain as PM
The votes have been cast and the counting is underway as the UK decides if its future lies within the European Union.
Ukip leader Nigel Farage has said he believes Britain has voted to remain in the European Union, but declared: "Win or lose this battle, we will win this war."
Speaking as votes in the EU referendum were being counted across the country, the leading Brexit campaigner told supporters: "The Eurosceptic genie is out of the bottle and it will now not be put back."
Other senior Leave figures declined to back Mr Farage's assessment, which he told the Press Association was based on information from private exit polls conducted by friends in the City, as well as his personal sense of how referendum day had gone.
But the first result to be announced in the UK gave only a slender lead of 50.7% to 49.3% for Remain in Newcastle-upon-Tyne, which had been expected to give a more enthusiastic thumbs-up for EU membership.
With no exit polls conducted by broadcasters, a reliable picture of the likely outcome was not expected to emerge until the early hours of Friday, with the final result expected at breakfast time. But the final poll of the campaign forecast a Remain victory by a margin of 52% to 48%.
Meanwhile, Conservative supporters of Brexit including Boris Johnson and Michael Gove wrote to David Cameron urging him to stay on as Prime Minister regardless of the result, as Tories battled to restore a unity riven by weeks of divisive "blue-on-blue" fighting.
Some 84 Leave-backing Conservatives signed a letter to tell the PM: "We believe whatever the British people decide you have both a mandate and a duty to continue leading the nation implementing our policies."
As well as Mr Johnson and Mr Gove, the signatories included Cabinet-level Brexit backers Chris Grayling, Theresa Villiers and John Whittingdale.
But former Cabinet ministers Owen Paterson, Cheryl Gillan and David Jones, along with influential backbenchers David Davis and Bernard Jenkin, did not sign.
Former work and pensions secretary Iain Duncan Smith, who quit the cabinet weeks before the referendum, did not sign but said he thought Mr Cameron should stay.