The country does not leave the EU overnight.
Here is Prime Minister David Cameron’s speech following Britain’s vote to leave the European Union in full:
David Cameron has quit as Prime Minister this morning after failing in his bid to keep the UK in the EU.
A "tight battle" between campaigners on both side of the Brexit debate came to a close with Aberdeenshire voting to remain part the European Union.
At the precise moment Ukip leader Nigel Farage was "daring to dream" of winning the EU referendum the Highlands was trying its damnedest to wake him.
Moray has supported the UK's European Union membership - but only by 122 votes.
So we have it – the only identified trigger of another vote on independence has been pulled.
The pound has dropped to its lowest level in more than 30 years as Britain appeared to have backed a decision to leave the EU.
First Minister Nicola Sturgeon has welcomed Scotland’s “unequivocal” vote to stay in Europe after all 32 local authorities delivered a vote for Remain.
The UK was heading for Brexit this morning after huge parts of England and Wales voted to leave the European Union.
What could happen next? Four potential scenarios