What has happened?
A referendum - a vote in which everyone (or nearly everyone) of voting age can take part - was held on Thursday 23 June, to decide whether the UK should "Leave" or "Remain" in the European Union.
"Leave" won by 52% to 48%.
The referendum turnout was 71.8%, with more than 30 million people voting. It was the highest turnout in a UK-wide vote since the 1992 general election.
What was the breakdown across the UK?
England voted strongly for Brexit, by 53.4% to 46.6%, as did Wales, with "Leave" getting 52.5% of the vote and "Remain" 47.5%.
Scotland and Northern Ireland both backed staying in the EU. Scotland backed "Remain" by 62% to 38%, while 55.8% in Northern Ireland voted "Remain" and 44.2% "Leave".
What is the European Union?
The European Union - often known as the EU - is an economic and political partnership involving 28 European countries (click here if you want to see the full list). It began after World War II to foster economic co-operation, with the idea that countries which trade together are more likely to avoid going to war with each other.
It has since grown to become a "single market" allowing goods and people to move around, basically as if the member states were one country.
It has its own currency, the euro, which is used by 19 of the member countries, its own parliament and it now sets rules in a wide range of areas - including on the environment, transport, consumer rights and even things such as mobile phone charges. Click here for a beginners' guide to how the EU works.
What does Brexit mean?
It is a word that has become used as a shorthand way of saying the UK leaving the EU - merging the words Britain and exit to get Brexit, in a same way as a Greek exit from the EU was dubbed Grexit in the past.
What happens now?
For the UK to leave the EU it has to invoke an agreement called Article 50 of the Lisbon Treaty.
Cameron or his successor needs to decide when to invoke this - that will then set in motion the formal legal process of withdrawing from the EU, and give the UK two years to negotiate its withdrawal.
The article has only been in force since late 2009 and it hasn't been tested yet, so no-one really knows how the Brexit process will work, according to BBC legal correspondent Clive Coleman.
Mr Cameron, who has said he would be stepping down as PM by October, said he will go to the European Council next week to "explain the decision the British people have taken".
EU law still stands in the UK until it ceases being a member - and that process could take some time.
The UK will continue to abide by EU treaties and laws, but not take part in any decision-making, as it negotiates a withdrawal agreement and the terms of its relationship with the now 27 nation bloc…
Some say we could still remain in the single market - but what is a single market?
The single market is seen by its advocates as the EU's biggest achievement and one of the main reasons it was set up in the first place.
Britain was a member of a free trade area in Europe before it joined what was then known as the common market. In a free trade area countries can trade with each other without paying tariffs - but it is not a single market because the member states do not have to merge their economies together.
The European Union single market, which was completed in 1992, allows the free movement of goods, services, money and people within the European Union, as if it was a single country.
It is possible to set up a business or take a job anywhere within it. The idea was to boost trade, create jobs and lower prices. But it requires common law-making to ensure products are made to the same technical standards and imposes other rules to ensure a "level playing field".
Critics say it generates too many petty regulations and robs members of control over their own affairs. Mass migration from poorer to richer countries has also raised questions about the free movement rule. Read more: A free trade area v EU single market
Has any other member state ever left the EU?
No nation state has ever left the EU. But Greenland, one of Denmark's overseas territories, held a referendum in 1982, after gaining a greater degree of self government, and voted by 52% to 48% to leave, which it duly did after a period of negotiation. The BBC's Carolyn Quinn visited Greenland at the end of last year to find out how they did it...
How will pensions, savings, investments and mortgages be affected?
During the referendum campaign, the prime minister said the so-called "triple lock" for state pensions would be threatened by a UK exit. This is the agreement by which pensions increase by at least the level of earnings, inflation or 2.5% every year - whichever is the highest.
If economic performance deteriorates, the Bank of England could decide on a further program of quantitative easing, as an alternative to cutting interest rates, which would lower bond yields and with them annuity rates. So anyone taking out a pension annuity could get less income for their money.
The Bank of England may consider raising interest rates to combat extra pressure on inflation. That would make mortgages and loans more expensive to repay but would be good news for savers.
The Treasury previously forecast a rise of between 0.7% and 1.1% in mortgage borrowing costs, with the prime minister claiming the average cost of a mortgage could increase by up to £1,000 a year.
The Treasury argued during the referendum campaign that UK shares would become less attractive to foreign investors in the event of Brexit and would therefore decline in value, but in the longer term shares typically rise with company profits. Big exporters might benefit from the weaker pound, so the value of their shares might well rise, while importers might see profits squeezed.
Who wanted the UK to leave the EU?
The UK Independence Party, which won the last European elections, and received nearly four million votes - 13% of those cast - in May's general election, campaigned for Britain's exit from the EU.
About half of Conservative MPs, including five cabinet ministers, several Labour MPs and the DUP were also in favour of leaving.
What were their reasons for wanting the UK to leave?
They said Britain was being held back by the EU, which they said imposed too many rules on business and charged billions of pounds a year in membership fees for little in return. They also wanted Britain to take back full control of its borders and reduce the number of people coming here to live and/or work.
One of the main principles of EU membership is "free movement", which means you don't need to get a visa to go and live in another EU country. The Leave campaign also objected to the idea of "ever closer union" and what they see as moves towards the creation of a "United States of Europe".
Who wanted the UK to stay in the EU?
Prime Minister David Cameron wanted Britain to stay in the EU. He sought an agreement with other European Union leaders to change the terms of Britain's membership…
What were their reasons for wanting the UK to stay?
Those campaigning for Britain to stay in the EU said it gets a big boost from membership - it makes selling things to other EU countries easier and, they argued, the flow of immigrants, most of whom are young and keen to work, fuels economic growth and helps pay for public services.
They also said Britain's status in the world would be damaged by leaving and that we are more secure as part of the 28 nation club, rather than going it alone…
For the entire article, click here.