Now it has officially been announced Britain is leaving the European Union, voting 51.9% to 48.1% in favour, negotiations over the terms of the country's exit will take place.
Article 50 of the 2007 Lisbon Treaty envisages a two-year negotiation to draw up a withdrawal agreement.
If no deal is reached and any of the other 27 states block an extension of talks, the EU treaties simply cease to apply to the state in question at the end of the period.
This would leave Britain to operate under international rules set by bodies such as the World Trade Organisation (WTO).
Mr Cameron previously said he would kick off the withdrawal process immediately but he is now leaving this decision to his successor.
Tory minister and Leave campaigner Andrea Leadsom said Britain could negotiate a bilateral agreement with a "presumption of continuity" of free trade.
Labour leader Jeremy Corbyn called for article to be acted upon immediately but Boris Johnson said there was "no rush" to do so.
The value of the pound plummeted to its lowest level in 31 years as the Leave campaign began to look the likely victors.
Sterling fell to a three-decade low after the news Britain voted to leave and in early trading shares for banks including RBS saw double-digit falls.
The value of Brent crude also fell below $48 a barrel on Friday morning.
The markets are expected to remain volatile. Soon after opening, more than £100bn was wiped off the FTSE 100 Index and the pound crashed against the dollar.
The Bank of England is ready to offer £250bn to support the markets with contingency plans in place, according to governor Mark Carney.
Chancellor George Osborne has discussed possibly suspending trading on the London Stock Exchange in the event that Brexit triggers a "Black Friday" crash.
On the steps of Downing Street shortly after 8am, David Cameron said: "I will do everything I can as Prime Minister to steady the ship over the coming weeks and months but I do not think it would be right for me to try to be the captain that steers our country to its next destination.
"This is not a decision I've taken lightly but I do believe it's in the national interest to have a period of stability and then the new leadership required.
"There is no need for a precise timetable today but in my view we should aim to have a new Prime Minister in place by the start of the Conservative Party conference in October.
"Delivering stability will be important and I will continue in post as Prime Minister with my Cabinet for the next three months."
Bookmakers have made Leave campaigner Boris Johnson their favourite to take over from Mr Cameron and have also listed Michael Gove, Theresa May, George Osborne, Stephen Crabb and current Scottish Conservative leader Ruth Davidson among the front-runners.
Those who wish to stand must attract at least 41 nominations from their colleagues. If more than two candidates stand then an internal election among Conservative MPs will take place to narrow the contest down to only two candidates.
Ordinary Conservative members will then vote on who will lead the party out of the final two candidates.
Every area in Scotland voted to stay in the EU, with the overall figure 62% to 38%, and former First Minister Alex Salmond said he was "quite certain Nicola Sturgeon will implement the manifesto" for "indyref2".
Ms Sturgeon made a public statement - holding off until after a similar press conference from Boris Johnson, Michael Gove and Gisela Stuart - to respond to the outcome from both Scotland and Britain.
The First Minister said it was her job to act responsibly for the people of Scotland and set out immediate priorities before a meeting of the cabinet scheduled for Saturday morning.
Nicola Sturgeon said a second independence vote is "highly likely".
She said: "Unfortunately, yesterday's result in Scotland was not echoed across the UK. It remains my passionate belief that it is better for all parts of the UK to remain in the EU.
"There is no doubt that yesterday's result represents a significant and material change. My job now is to act in the interests of all in Scotland. The Cabinet will meet tomorrow morning to discuss our next steps in detail."
There will be questions about the future of other areas, with the Spanish government already calling for shared sovereignty over Gibraltar, which voted 95.9% in favour of Remain.
Meanwhile, the Turkish press were reporting that their own country's negotiations in entering the European Union, which began in 2005, could be put into jeopardy because of Britain's decision.
Headlines in America and around the world reflected the unexpected result of the referendum with the New York Times saying "British Stun World" with the Sydney Morning Herald questioning "Anarchy in the UK?".
Last night's result also raises profound questions about the border between the Republic of Ireland and Northern Ireland.
Under the Common Travel Area, nationals from the Ireland and the UK can travel and live in either country without immigration controls.
The Irish Times reported on Sinn Fein's calls during the night for a vote on the unification of Ireland after Northern Ireland, like Scotland, voted to remain.
According to The Journal: "Under the Good Friday Agreement, the Northern Ireland Secretary can initiate a poll in circumstances where it was clear public opinion had swung towards Irish unity.
"Then the Republic would vote on the matter."