The prime minister leaves No 10 with his wife, Samathan, to give his statement. He said he expects to leave office before OctoberTimes photographer Richard Pohle

David Cameron dramatically announced his resignation this morning after a shock vote for Brexit that changes the country’s political landscape and shatters the continent’s postwar settlement.

Speaking on the steps of Downing Street after the referendum result, Mr Cameron pleaded for calm as he said he was not the right man to lead Britain out of the European Union and a new leader needed to be in place by the Tory conference in October.

“The British people have voted to leave the European Union and their will must be respected,” said Mr Cameron. “The will of the British people is an instruction that must be delivered.

“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 have 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.”

Appearing close to tears, he finished by saying: “I love this country and I feel honoured to have served it and I will do everything I can in future to help this great country succeed. ”

His resignation came after swathes of England and Wales ignored the prime minister’s warnings on the economic consequences of Brexit to express their anger over immigration and inequality in a popular revolt that has left the country deeply divided.

Mr Cameron said the country had “just taken part in a giant democratic exercise, perhaps the biggest in our history. Over 33 million people from England, Scotland, Wales, Northern Ireland and Gibraltar have all had their say.

“We should be proud of the fact that in these islands we trust the people for these big decisions.”

He defended his decision to hold the referendum, stating: “We not only have a parliamentary democracy, but on questions about the arrangements for how we’ve governed there are times when it is right to ask the people themselves, and that is what we have done.”

The pound plunged to a 31-year low as global markets reacted to the prospect of years of uncertainty, including over the future of the UK itself.

The Bank of England said it would “take all necessary steps to meet its responsibilities for monetary and financial stability”, adding that it had made contingency plans in a bid to avert panic.

In a speech this morning Mark Carney, the governor, said he “stands ready to provide” more than £250 billion of funds to aid the smooth functioning of markets after the Brexit vote.

“The people of the United Kingdom have voted to leave the European Union. Inevitably, there will be a period of uncertainty and adjustment following this result,” he said.

Pledging, however, to try to ensure stability, he said: “As a backstop, and to support the functioning of markets, the Bank of England stands ready to provide more than £250 billion of additional funds through its normal facilities. The Bank of England is also able to provide substantial liquidity in foreign currency, if required.”

However, Britain is expected to lose its last remaining triple-A credit rating, with the agency S&P warning that maintaining it is “untenable”.

A string of senior business figures spoke out this morning. Carolyn Fairbairn, the CBI boss, said the markets needed to be calmed. “We now need mature immigration policies that address public concerns and we must protect trade deals,” she said.

Donald Tusk, the European Council president, immediately said that EU law would continue to apply in the UK until it formerly left. He said the remaining EU members would discuss how to deal with Brexit. “What doesn’t kill you makes you stronger,” he said.

Better-than-expected results for Leave outside the capital left Mr Cameron clinging to the hope that wins in London and Scotland could spare him from humiliating referendum defeat.

But at 4.39am the BBC called the result for Leave with a projected vote share of 52 against 48 for Remain. At the final result, 33,577,342 votes had been cast, with 16,141,241 in favour of Remain and 17,410,742 in favour of Leave.

The referendum results exposed a country polarised, with London, Scotland and Northern Ireland the only regions with a majority Remain vote.

Alex Salmond, the former Scottish first minister, said he was certain that his successor, Nicola Sturgeon, would now demand a second independence referendum.

Nigel Farage, the Ukip leader, called it a “victory for real people, a victory for ordinary people, a victory for decent people”.

However, in an admission that will anger pro-Remain campaigners, Mr Farage said that the Leave campaign had been wrong to say that leaving the EU would mean there would be an extra £350 million a week to spend on services like the NHS.

“I would never have made that claim and it was one of the mistakes the Leave campaign made,” he told ITV’s Good Morning Britain.

Mr Farage later called for the formation of a “Brexit government” and demanded that negotiations to set in process Britain’s secession from the union begin “as soon as humanly possible”.

The Ukip leader said he hoped the result would spark the collapse of the bloc. “I hope we’ve knocked the first brick out of the wall,” he said, predicting that the Netherlands and Denmark could be the next nations to follow Britain’s lead.

Appearing in Westminster, he called for June 23 to become a bank holiday and be known forthwith as the UK’s independence day.

Reflecting on the result of the ballot, Mr Farage said: “The election was won in my view in the Midlands and the north and it was the old Labour vote that came to us.” He predicted that Ukip “could become the new Labour party”.

The ballot is set to stoke further calls for similar plebiscites in other member states of the bloc. This morning Marine Le Pen, leader of the French far-right party Front National, seized on the UK result, tweeting her delight and demanding an in/out EU referendum in France.

With the nature of that exit now set to dominate the agenda in Brussels and Westminster, one Tory MP, Jacob Rees-Mogg, said that there may have to be another general election to mandate the renegotiation.

The insurgency that first registered in northeast England gathered force through the night with hammer blows to Remain’s hopes from Swansea, Sheffield and Coventry. The final death knell was sounded shortly after 4.30am when Birmingham voted Leave.

Newcastle upon Tyne, deemed one of the most Remain-leaning of the 382 counting areas, provided the first real indication of the night. Although Remain won, the very narrow margin of below 1 per cent was much less than had been predicted.

In the next significant result Sunderland voted overwhelmingly for Leave, with 61 per cent against 39 per cent for Remain. The pattern was repeated elsewhere, suggesting that Labour had failed to persuade its traditional supporters to reject Brexit.

Although Remain registered bigger-than-expected victories in many London boroughs, some Scotland areas and in Liverpool, they were not large enough to offset thumping wins for Leave elsewhere.

Mr Cameron had relied heavily on warnings of the damaging economic consequences of Brexit from a chorus of experts as he made the case to stay in.

However Stephen Crabb, the work and pensions secretary, said that in many old industrial, white, working-class areas in England and Wales “a large number of voters saying ‘sorry, we just don’t believe the Labour party or the government in the way they tell us that Europe and the European Union is good for us’.”

Very high levels of turnout in Leave areas suggested that the Brexit campaign had mobilised sections of the electorate in a popular revolt against the political and financial elites. Iain Duncan Smith, one of the most prominent members of Vote Leave, said: “I’ve never seen turnout in council estates this high. People who don’t normally vote are voting, that’s why we don’t know.”

As some senior Labour figures started to predict a Leave win, recriminations began. Calls resurfaced for Jeremy Corbyn to step down and Chris Bryant, shadow leader of the House of Commons, suggested to guests at the Stronger In party that he might punch “tosspot” Ed Miliband over the state in which he left Labour. Mr Miliband is expected to join the shadow cabinet.

Some Tory MPs, by contrast, mounted an immediate show of unity when the polls closed, with 86 Brexit-supporting MPs, including cabinet ministers, releasing a letter saying that Mr Cameron had “a duty to stay on”. This is just over half the 138 Tory MPs who backed Brexit.

Alex Salmond, the former SNP leader, said that a Brexit vote would trigger another independence referendum in Scotland. “Scotland looks like it’s going to vote solidly Remain. If there was a Leave vote in England, dragging us out the EU, I’m quite certain Nicola Sturgeon would implement the SNP manifesto.”

The party’s manifesto ahead of May’s Scottish parliament election said Holyrood should have the right to hold a second independence vote if there was a “significant and material” change in circumstances from 2014 such as Scotland being taken out of the EU.