The British people have voted and the results are in: we are going to leave the European Union.
But what's going to happen next? We take a look at the possibilities.
Sterling has already had a rough ride as the polling results came in, and more turmoil could follow.
The pound dropped to its lowest level in more than 30 years at 1.3305 dollars, wiping around 10% off the value of the currency, and one analyst said "it's definitely tin hats time".
David Cameron's position
Publicly, both sides have said David Cameron should stay on as PM after a Leave vote, but this is seen as politically unrealistic by many observers.
Cameron could face a vote of no confidence. Pro-Brexit Tory MPs should be able to command the 50 signatures needed to trigger such a vote.
Cameron might also decide to resign himself. He may not go immediately, but announce a slow-motion resignation which would see him hand over power in the autumn.
A major overhaul of Cabinet is likely as the Tories try to heal the deep wounds created by an intensely bitter and personalised "blue on blue" campaign.
Mr Johnson is almost certain to enter Cabinet, while Michael Gove has been spoken of as a deputy prime minister.
The position of George Osborne looks uncertain as many pro-Brexit MPs privately insist he cannot stay Chancellor after the way he has used Treasury figures to attack their cause.
The Labour Party
There could be major backlash against Labour leader Jeremy Corbyn from MPs who feel he led a lacklustre effort to keep Britain in the EU. Labour infighting resurfaced as the polls were counted, with many of the party's heartlands overwhelmingly backing Brexit.
The Leave vote will formally trigger withdrawal from the EU by invoking article 50 of the Lisbon Treaty which would then lead to a two-year negotiation period on the terms of the "divorce". However there is disagreement over whether the trigger is pulled right away.
Some in the Brexit camp have said Britain may continue as an EU member for up to four years, so could hold informal talks with Brussels first.
Negotiations will determine whether the UK remains part of the single market without being in the Union, as Norway currently does. However, this would mean the UK would still have to accept free movement of labour.
Other options include a Canadian-style free trade deal, a Swiss-style bilateral agreement, or reverting to the basic terms of commerce offered by membership of the World Trade Organisation.
The pro-Leave side signalled before the vote that they intend to bring in emergency legislation to try to halt an "influx" of migrants if Britain votes to quit the EU.
They said an Asylum and Immigration Control Bill would "end the automatic right of all EU citizens to enter the UK by the next election."
Emergency legislation will be brought to ban European judges giving rulings on UK laws, the Leave side have said.
A European Union Law (Emergency Provisions) Bill would be fast-tracked through parliament to "immediately end the rogue European Court of Justice's control over national security, allow the Government to remove EU citizens whose presence is not conducive to the public good, including terrorists and serious criminals", the Leave side said.
A European Communities Act 1972 (Repeal) Bill would mean that by 2020 "the legal basis for the supremacy of EU law in the UK" will be gone as parliament decides which parts of EU law to keep.
The United Kingdom
With Scotland more firmly pro-EU than their English neighbours, there will be fear that the Scottish National Party will use the Leave vote to push for a second independence referendum.
If that wasn't enough to break up the union, the Good Friday agreement was based in EU law, which means the Brexit vote could undermine the peace process in Northern Ireland.
Further legislation would see a Finance Bill that would "abolish the 5% rate of VAT on household energy bills by the date of the next general election by amending the Value Added Tax Act 1994, and will be a major benefit for low income households. This will be paid for by savings from the UK's contributions to the EU budget."
A National Health Service (Funding Target) Bill would "require that by the next general election, the NHS receives a £100 million per week real-terms cash transfusion over and above current plans," the Leave side have said.