London: British politics was upended Friday by a shock vote to leave the EU which forced Prime Minister David Cameron to resign, triggered a leadership race and raised doubts the country could survive in its current form.

Announcing his resignation outside Downing Street, Cameron said a new leader should be in place by October.

His successor faces an uphill struggle to heal divisions in both the country and the ruling Conservative party and could face pressure to call a new general election, even though it is just a year since Cameron won the last one.

There were already signs that pro-EU Scotland could move to hold a fresh independence referendum, as well as fears that stability in Northern Ireland could be threatened by the move.

The main opposition Labour party was not immune from the turmoil, either.

Its leader, veteran socialist Jeremy Corbyn, had campaigned reluctantly to keep Britain in the EU.

An MP has tabled a motion of no confidence in him following the result after many traditional Labour areas backed Brexit.

“The ramifications leave one giddy,” wrote political commentator Matthew d’Ancona in The Guardian.

“Yes, this will have immense consequences for the Westminster drama: not only for David Cameron, who bet the farm and lost; but also for Jeremy Corbyn who conspicuously failed to deliver the Labour heartlands,” he said.

“But the high political soap opera is belittled by the constitutional and economic implications.”

Anand Menon, director of the UK In A Changing Europe academic research group, added: “Nationalist politicians, be they in Scotland, Northern Ireland or England, will be making hay.”

Favourite to succeed Cameron is Boris Johnson, the leading Brexiteer and former London mayor.

Other contenders seen as closer to Cameron could include Home Secretary Theresa May and finance minister George Osborne.

Once the leading contender to succeed Cameron, Osborne’s hopes may have been damaged by his closeness to the premier and his botched handling of two austerity budgets.

Whoever wins will face having to unite a party which has experienced bitter divisions during a referendum campaign which has pitched Conservative against Conservative.

They will also inherit Cameron’s small House of Commons majority of 16, making it tough to pass any controversial new laws.

Corbyn, who won the Labour leadership last year thanks to grassroots support, much of it from young voters, is deeply unpopular with many MPs.

John Mann, a pro-Brexit Labour MP, said he was “out of touch” with traditional working-class Labour voters who were “sick to death” with his policies.

The constitutional consequences of the vote could run deeper.

Scotland’s ruling Scottish National Party has long indicated that a Brexit vote could provide momentum for a second referendum after independence was rejected in a previous vote in 2014.

First Minister Nicola Sturgeon said Friday that Scotland sees its future as “part of the EU,” fueling speculation.

In Northern Ireland, which backed EU membership, there are fears that tensions could be raised following years of calm in sectarian conflict if a hard border with EU member state Ireland is restored.

Republicans Sinn Fein have already called for a vote on uniting Northern Ireland with the Republic of Ireland after the Brexit vote.

“What the government is now faced with is not only the economic consequences of a break with the EU, but a fracturing of the United Kingdom,” said Rodney Barker, emeritus professor of government at the London School of Economics.

“The government has avoided, once again, taking the blame for the erosion of public services, but at the cost of the unity of its party and its country.”

Admitting the losses in Labour heartlands, Corbyn made the same point about an anti-austerity vote.

“A lot of the message that has come back from this is that many communities are fed up with cuts,” he said.