The UK would be the first state to leave the EU but it is most likely that the European Commission, the executive arm of the EU, will do the negotiating on behalf of the remaining 27 member states.
Britain looks on course to leave the EU. This is having an immediate effect on markets. It will have immediate political ramifications too. David Cameron will, fairly soon, need to decide if he can continue in his role as British prime minister.
Legally speaking, though, the process of actually leaving will take a lot longer. Britain will now enter a kind of phoney Brexit period. It is still a member of the EU. The referendum vote is not as such legally binding. It is advisory only – but if it is out it creates a political imperative for the UK government to arrange its exit of the EU.
The law governing Brexit is found in Article 50 of the EU Treaty. This is a provision adopted by EU member states in 2009 to govern Brexit-like scenarios. It puts a two-year time limit on withdrawal negotiations. When the two years is up (or on the date any agreement reached before this enters into force) the UK is officially out of the EU.