Brexit: UK first country to leave EU
UKIP leader Nigel Farage hailed it as the UK's "independence day" but the Remain camp called it a "catastrophe". The pound fell to its lowest level against the dollar since 1985 as the markets reacted to the results.
The referendum turnout was 71.8% - with more than 30 million people voting - the highest turnout at a UK election since 1992. Wales and the majority of England outside London voted in large numbers for Brexit.
Labour's Shadow chancellor John McDonnell said the Bank of England may have to intervene to shore up the pound, which lost 3% within moments of the first result showing a strong result for Leave in Sunderland and fell as much as 6.5% against the euro.
UKIP leader Nigel Farage - who has campaigned for the past 20 years for Britain to leave the EU - told cheering supporters "this will be a victory for ordinary people, for decent people".
Germany's foreign minister Frank Walter Steinmeier described the referendum result as as "a sad day for Europe and Great Britain".
Scotland's First Minister Nicola Sturgeon has said that the EU vote "makes clear that the people of Scotland see their future as part of the European Union" after all 32 local authority areas returned majorities for Remain.
London has voted to stay in the EU by around 60% to 40%. However, no other region of England has voted in favour of remaining.
Britain would be the first country to leave the EU since its formation - but a leave vote will not immediately mean Britain ceases to be a member of the 28-nation bloc.
That process could take a minimum of two years, with Leave campaigners suggesting during the referendum campaign that it should not be completed until 2020 - the date of the next scheduled general election. ■