Scottish Political Correspondent Andrew Liddle considers what is next for us following the Brexit vote.
The UK:
The Prime Minister has said he will invoke Article 50 in three months time. That is the mechanism, laid out in the Lisbon Treaty, for leaving the EU.
Britain will then begin a long and complex process of separating its laws and institutions from Brussels. Up to two-years is allowed for this, although the period can be extended with the consent of all member states. Senior EU figures are likely to make the process as cumbersome and painful as possible, to deter other member states from holding referenda of their own.
Scotland:
Scotland has voted resoundingly in favour of staying in the EU. Nicola Sturgeon is already trying hard to make this vote a reality. One possibility is gaining independence from the rest of the UK, but this would not necessarily guarantee continued EU membership. Even if Scotland were to apply to rejoin they would face obstacles, such as a possible veto by Spain. They would also have to, at least in principle, commit to using the Euro.
An alternative would be to see if a compromise for Scotland could be reached with EU member states without plumping for independence. Such a move could, for instance, involve the UK member state being redefined as Scotland, or possibly with Northern Ireland.
In either scenario, it is most likely a physical border would have to be erected between Scotland and England.
The EU:
Brussels now has a battle on its hands. Populist and anti-European forces across other member states are chomping at the bit to hold votes of their own. Amid austerity politics and the migrant crisis, there is a fear that voters in countries such as Holland, Denmark and Italy would also back leaving the EU.
Such a move would be disastrous – probably fatal – for the EU project. Senior figures, particularly the presidents of the Commission, Council and Parliament, are likely to rail hard against any such moves. Domestic elections next year in France and Germany could add additional pressure on leaders in those countries to hold referendums on the EU.