Screenshot from the BBC shows the results after all votes have been counted.
British voters elected to leave the European Union in a historic decision that will have far-reaching repercussions both domestically and internationally, and immediately plunged the 28-member political and economic union into its worst crisis since it was founded.
In a campaign that was at times bitter and acrimonious, the Leave campaign, headed by former London Mayor Boris Johnson, took 51.9 percent of the vote to the 48.1 percent that the Remain campaign, headed by Prime Minister David Cameron. According to the British Broadcasting Corporation, 72 percent of the electorate voted.
The result had an immediate effect on the financial markets, with the pound plunging to a 30-year low against the U.S. dollar and the euro, Europe's single currency, slid 3 percent against the U.S. currency.
Reaction was immediate.
Whilst maverick UKIP leader Nigel Farage, a fervent anti-EU campaigner, proclaimed June 23 as Independence Day for the UK, others were shocked.
"Never in a thousand years would I have believed that the British people would have voted in this way. This is catastrophic for our country," said Keith Vaz, a Labour member of parliament who is chairman of the powerful Home Affairs Committee.
Chuka Umunna, a Labour legislator and a prominent Remain campaigner, described the decision as a "seismic event for our country."
Scotland voted overwhelmingly to remain in the European Union and Nicola Sturgeon, the country's first minister, hinted that her SNP party may seek a fresh referendum on Scottish independence; the SNP narrowly lost a national vote on quitting the United Kingdom in 2014.
JK Rowling, multi-millionaire author of the Harry Potter series of books, was a prominent backer of the Remain campaign, and tweeted: ``Scotland will seek independence now: Cameron's legacy will be breaking up two unions. Neither needed to happen.''
Most analysts seemed unclear what exactly will happen next. Cameron himself said before the vote that in the event of a Leave victory he would immediately initiate Article 50 of the EU accession treaty, which would in effect start then negotiation process for Britain's departure.
However Cameron has two years in which to invoke the start of the exit process, and there have been suggestions that it might be delayed in order to negotiate the best departure terms.
What has not yet become clear is the future of Britain's relations with two of its major trading partners, China and the U.S..
The U.S. has for years had British membership of the EU a core part of its European policy, while the UK and China are experiencing what Cameron and President Xi Jinping labelled "a golden era" after the Chinese leader's state visit to Britain last October, when deals worth 40 billion sterling were announced.
China's official reaction, as voting got under way, was outlined by Foreign Ministry spokesman Hua Chunying at her regular press conference in Beijing on June 23.
"We follow closely the upcoming referendum in the UK. We respect the choice made by the British people, China always supports the integration of Europe, and is happy to see a united, robust and stable EU play a significant role in international affairs," she said.
"China attaches great importance to its relations with the UK, and is willing to carry out mutually beneficial cooperation with the UK across the board."