Mr Cameron said he would remain in office for the next few months to “steady the ship” while the Conservative party chose a new leader but that Britain needed “fresh leadership” to take it in the new direction chosen by voters.
Britons voted by 51.9 per cent to sever the UK’s 43-year membership of the EU, sending shockwaves across Europe and triggering financial market turmoil across the globe.
The result represented the biggest political upheaval in Britain in living memory, dismaying allies and pitching the country into a period of intense political and economic uncertainty.
The scale of the problems confronting the British government were immediately laid bare when Nicola Sturgeon, first minister of Scotland, which voted to stay in the EU, said a second vote on independence “is on the table” two years after the last plebiscite.
London also ran into immediate resistance from Brussels. EU leaders said there would be no renegotiation of Britain’s membership terms and demanded that London swiftly engage in exit talks and invoke article 50 of the EU treaties, which sets a two-year deadline.
Mr Cameron, in line with Leave campaigners, said triggering the process would be a matter for his successor, who will not take over until the autumn.
Mr Cameron had gambled his political future on the referendum but his hopes of securing a Remain vote evaporated as working-class voters turned out in huge numbers to deliver a stunning rebuke to the establishment and the status quo.
Boris Johnson, who spearheaded the Leave campaign and is now favourite to take over as Tory leader, paid tribute to Mr Cameron as a “brave and principled man” but insisted holding the referendum was “right and inevitable”.
“The EU was a noble idea for its time. It is no longer right for this country,” Mr Johnson said.
After rallying all week on hopes that Britain would stay, markets were stunned by the referendum outcome. The pound dived to a 30-year low, setting a record intraday swing of more than 10 per cent between its high and low points; the FTSE 100 slumped 8.7 per cent on opening before trimming losses to 4.3 per cent. Bank stocks took a hammering, with Lloyds down 22 per cent, Royal Bank of Scotland down 18 per cent and Deutsche Bank falling 17 per cent.
The Euro Stoxx bank index fell 17 per cent, back to levels last seen at the depths of the eurozone debt crisis in August 2012.
Mark Carney, governor of the Bank of England, said it “will not hesitate to take additional measures as required as markets adjust”, insisting that the BoE was “well prepared” for volatility after extensive contingency planning and that the financial system was more resilient than at the time of the financial crisis.
The European Central Bank also said it was standing by to inject extra liquidity.
In Europe, the eurozone periphery economies were on course for their worst trading days in history. Spain’s Ibex index was down 12 per cent, its largest decline since launching in 1992.
While the German 10-year Bund yield fell 27bp to a record low of minus 0.18 per cent, periphery EU debt weakened sharply, with Italy’s 10-year yield up 30bp to 1.53 per cent.
The 10-year UK Gilt yield fell to a record low of 1.02 per cent, down 35bp before easing back to 1.09 per cent.
Barometers of risk aversion for investors soared in value, with the 10-year US Treasury yield falling 25 basis points to 1.49 per cent, the lowest level since 2012.
The vote to leave could have immediate consequences for UK businesses beyond the City of London. Shares in airlines, travel companies and media groups were particularly hard hit.
The result could damage the chances of Tata Steel, Britain’s biggest steel producer, maintaining its operations in the UK, according to a person close to the company.
US stock-index futures fell more than 5 per cent as global equities slumped.
Shares in Japan closed down more than 7 per cent as the yen appreciated sharply against the pound and dollar. The pound was down about 14 per cent against the Japanese currency.
The Swiss National Bank became the first central bank to intervene directly in the markets, as it sought to curb the appreciation of the franc.
The referendum also sent political shockwaves across Europe and beyond, as EU tried to calibrate their response to the biggest setback in the bloc’s history.
“I am fully aware of how serious or even dramatic this moment is politically and there is no way of predicting all the political consequences of this event especially for the UK,” said Donald Tusk, European Council president, adding that it was “not the moment for hysterical reactions”.
But Eurosceptic parties were quick to draw inspiration. “Victory for liberty!” tweeted Marine Le Pen, France’s far-right leader. “We must now have the same referendum in France and other EU members.”
The Eurosceptic PVV party in the Netherlands also called for a referendum. “Great Britain has shown Europe the road to the future and liberation,” it said.
Norbert Röttgen, chairman of the Bundestag foreign affairs committee and a senior member of chancellor Angela Merkel’s CDU party, said the UK vote to leave was “the biggest catastrophe in the history of European integration”.
French president François Hollande said Brexit put the EU “gravely” to the test. “The danger is immense in the face of extremism and populism,” he said in a televised address. “It is always quicker to unwind than to construct, to destroy than to build. France, as a founder of the EU, will not accept it.”
Speaking in Scotland, Donald Trump, the Republican presidential candidate, praised the judgment of the British people. “They took their country back . . . people around the world are angry.”
Mr Cameron said he had put his “head, heart and soul” into leading a cross-party coalition for Remain, backed by Britain’s biggest companies, economists and trade unionists, but swaths of the country simply ignored the warnings of the economic danger of Brexit.