I DON’T know about the farce, but it certainly felt like history repeating itself as tragedy. David Cameron, holding back the tears, announcing his resignation the morning after a referendum defeat. It reminded me of Alex Salmond’s resignation speech on the morning after the Scottish independence referendum in 2014. All Cameron needed to say was that the dream will never die.

But the European dream has died, at least for Britain. There’s no way back from Thursday’s vote to leave the EU. It was the greatest gamble taken by the British establishment in the last 50 years and the Westminster establishment lost. The EU referendum was a colossal miscalculation by a metropolitan Tory leader who clearly never believed sensible, moderate Britain would vote for Brexit.

Project Fear would frighten voters into line, he thought, as it did in Scotland. Just pile on the statistics of doom from the Treasury, the IFS, the IMF, the Bank of England and people will stick with the status quo. It’s the economy. stupid. Only it isn’t. In England and Wales at least, it’s immigration, stupid. Perhaps someone should have advised Mr Cameron that Project Fear really didn’t work too well for Better Together in Scotland either.

Britain leaving the European Union after 40 years will be the most significant political development in our lifetimes, more important than the creation of the Scottish Parliament. I can still hardly believe it, 48 hours on. No more European Union passport. No more European Parliament elections. No more endless EU summits. No more stories about bent bananas – unless British business gets its way and we stay in the single European market. Any way you look at it, the press won’t have Brussels to kick around any more.

The reverberations across Europe will be profound and could lead to continental instability at a time when the EU is wrestling with the twin crises of migration and mass unemployment. Vladimir Putin will raise a glass or two at the shattering of European solidarity. No-one has actually left the EU before, apart from Greenland (population 85,000) in 1985. It’s not even supposed to be possible under the various EU treaties, which commit member states to “ever closer union”. Now the spell is broken and countries like Greece and Portugal, the Netherlands and Finland, realise it is possible to leave the EU, that preamble to the Treaty of Rome may have to be redrafted as “ever wider disunion”. The domino effect could even begin in France, where the Front National’s Marine le Pen is hailing Brexit as a “victory for freedom … a movement that cannot be stopped.”

Back home, it was a suitably confused and dysfunctional election night, as the opinion polls were revealed yet again to be about as reliable as a forecast of a barbecue summer. Of course, the polling organisations will say it was all within the “margin of error” – but what a margin. Even the Brexiteers believed that they had lost. The Ukip leader, Nigel Farage, wrong-footed us all by effectively conceding the result almost as soon as the polls closed. He was back six hours later, like a demented glove puppet, declaring that on the contrary it was “independence day”. Half the nation fell asleep believing we were still in Europe and then woke up in another country – and it didn’t sound like a very pleasant one.

UK politics is now dominated by the politics of immigration. The racial genie is finally out of the bottle, half a century after Enoch Powell’s “rivers of blood” speech, and it isn’t going back any time soon. The liberal delusion that Britons are a tolerant people – the happy multicultural family portrayed in countless BBC dramas and government information leaflets – will have to be revised. We’re not: at least not in the north of England.

We weren’t prepared for this harsh dose of reality. Following the death of the Labour MP Jo Cox, many in the UK media and Westminster political classes had persuaded themselves that it was all over for Leave – that a wave of emotion would save the day for Europe. I have to confess that I was guilty of participating in this group-think myself, always taking the best interpretation of the opinion polls, relying on anecdotal evidence that the Remain vote had hardened up. I was not alone. Briefings from Number 10 were extremely bullish on voting day based on the Government’s private polling, which seemed to indicate a comfortable victory for Cameron.

Then came Newcastle, and Sunderland. The north of England turned blue and the stock market plunged like a base jumper on crack cocaine. Pundits and politician in the TV studios gazed blinking at graphs of sterling falling off a cliff. Many of the guests interrogated by a crotchety David Dimbleby were simply lost for words. Even Brexiteers like the Tory minister, Teresa Villiers, were left open-mouthed when asked the apparently simple question: “What happens now?”

The truth is, no-one knows. There is the formal exit path under article 50 of the 2009 Lisbon Treaty which says a member state “may decide to withdraw from the EU in accordance with its own constitutional requirements”. That is classic Brussels speak for “just don’t ask”. The process is supposed to be time limited to two years, though even this can be stretched. This is secession, but not as we know it, because the European Union is not a state, but a legal anomaly. We are all citizens of this constitutional entity, and we have been subject to its laws for 40 years, but it is not a country in its own right. As always it will be for the lawyers to make a killing trying to make sense of it.

The hundreds of EU laws can’t all be scrapped at once – or perhaps they can. Some prominent Leavers, like the former Tory minister, John Redwood, author of Just Say No: 100 Arguments Against the Euro, are arguing that we can ignore article 50 altogether. The “newly sovereign British parliament” needn’t bother with such bureaucratic EU protocols, and should just pass a few bills ending the British budget contribution and free movement. Brexit campaigners believe that Germany needs to keep selling us all those BMWs and so trade will continue, and it probably will in some form or other. There is talk of some kind of “associate status” for Britain or “privileged partnership” with the EU.

However, it may not be the goods-exporting countries like Germany that decide Britain’s destiny, but the people-exporting countries such as Poland. With over a million of their citizens working in Britain, they are not likely to be enamoured of the new immigration barriers that will be erected after Brexit. The one thing we do know for certain is that Britain will be taking charge of its borders and that free movement is finished. Eastern European countries may want to erect a few reciprocal barriers against British trade.

It is not just the European Union that could be broken by this, but our own Disunited Kingdom. Even before the referendum result had been called by Prof Curtice, the Twittersphere was alive with speculation about another Scottish independence referendum. After all, many Scots had voted No in 2014 in large part because they believed the claims by Better Together and most of the media that only by remaining in the United Kingdom could Scotland be sure of remaining in the European Union.

Well, the unthinkable has happened and Scotland is being taken out of the European Union against its will and in face of an overwhelming vote to remain in a referendum. This may be a second-order constitutional crisis compared with Brexit itself, but it is a crisis nevertheless. Many Scots will want to hold on to their passports, and the protections of the European Union legal codes – not to mention EU environmental policies.

The First Minister, Nicola Sturgeon, in a powerful speech in Bute House on Friday, made clear that she will “take all possible steps and explore all options” to keep Scotland in the EU or at least in the Single European Market pro tem. She even promised to make “common cause” with London, laying to rest decades of nationalist enmity towards the UK capital or “dark star” as Alex Salmond used to call that city. The FM has also said that the “option of another independence referendum is already on the table”. And of course it must be. There is no way that Britain leaving the EU can do anything other than accelerate the arrival of Scottish independence.

I am on record as saying I didn’t believe another referendum would be possible in the next five years and probably longer. This is largely because of election fatigue. After four crucial elections in the last two years, everyone feels the need for some stability; a period of reflection. Nicola Sturgeon certainly seemed in no hurry to call the new referendum and had to dampen down the hopes of her enthusiastic followers after the general election Tsunami of 2015. Well – you’ll have had your stability. There’s gong to be no time for reflection as the fraught negotiations over Brexit dominate politics in the coming months and years.

Scotland’s anomalous position within the UK will inevitably be highlighted by these negotiations. As agricultural subsidies are withdrawn, laws on working conditions axed, controls on immigration imposed by the new Brexit-led Tory government, Scotland is bound to feel that it is losing out. It’s possible that a broad civic protest movement could emerge, inspired by the First Minister, to put pressure on Westminster and try to keep Scotland in some kind of continuing relationship with Europe. Eventually this could evolve into a campaign for another independence referendum as Scots realise that, once the two-year negotiation deadline is reached, it is their last chance. Westminster will insist that there is no case for another referendum, but if there is “clear and sustained demand”, as Sturgeon puts it, then I don’t believe Westminster would stand in its way for long.

Mind you, this referendum would be a difficult one for the Scottish Government to call. The presumption is that the EU would welcome Scotland with open arms, post-Brexit, but it may not be any keener on an independent Scotland joining now than it was in 2013/14. EU states such as Spain, fearful of secession movements in regions like Catalonia, might again block an early application from Scotland. The former president of the European Commission, Jose Manuel Barroso, told Scots then that “it would be extremely difficult if not impossible” and Scotland would “go to the end of the queue” to take its chances along with Turkey. If Europe does not explicitly welcome Scotland’s independent membership, a referendum would be a non-starter.

Then there is the British connection. The SNP insists that it still wants to remain in a currency union with the United Kingdom after independence, and retain many institutions like the monarchy and the BBC. If Britain is out of the EU it is going to be difficult to explain this to voters. It seems rather odd to say the least to want to keep the Bank of England in overall charge of the Scottish economy at the same time as Scotland is seeking to join the European Union. It would be a kind of push-me-pull-you independence, in which Scotland becomes a member of two antithetical unions – the UK and the EU. Scottish voters might be inclined to say: let’s stick with the devil we know.

Of course, a great deal depends on what happens politically now south of the Border. David Cameron was hardly a popular politician in Scotland, but he was regarded as a more moderate Tory than the Brexiteers. A Conservative government led by Prime Minister Boris Johnson and full of right-wingers like Iain Duncan Smith, John Redwood, and – heaven help us – Nigel Farage if he decides to cash in his Ukip chips and join the new Brexit Tories – could lead to revulsion in civic Scotland. Scottish voters have been used to seeing the agreeable, liberal face of Toryism in the shape of Ruth Davidson. But she might find herself unable to support her new leaders and Scots will want to create as much distance as possible from the new Westminster establishment. There seems little doubt that Boris Johnson is in line for Number 10 after his former Eton buddy, Cameron, steps down.

Thursday saw the gulf in political culture between Scotland and England widen to an aching chasm. The Brexit vote was partly driven the same anti-establishment politics that fuelled the Scottish independence referendum and galvanised many Scottish working-class people to vote. But there was a crucial difference. The English revolt was expressed very much as a revolt against immigrants and betrayed a hostility to foreigners that is lacking in Scotland.

Now, I don’t doubt that if levels of minority ethnic immigration to Scotland suddenly rose to the levels in England, there would be prejudice among Scots. It is a chauvinist delusion to believe that in some way the Scots are genetically incapable of hostility to foreigners. Nevertheless, race has not been a part of the political equation here and our bigots tend to be sectarian or anti-English rather than anti-immigrant.

What is happening in England is something very perplexing, not least to the Labour Party, which has lost touch with its core voters. The Brexit vote was a kick at the liberal left, educated elite who have come to dominate the party and who seem more concerned with promoting gender equality in corporate boardrooms than helping the British dispossessed, and who refuse to accept that immigration hits the wages of the low-paid.

Brexiteers suspect that their incomes are squeezed by competition from eight-to-a-room gangs from Romania and have stopped listening to economists claiming otherwise. They don’t value their EU passports because they can’t afford to travel there. They probably realise that immigration won’t stop just because Britain leaves the EU. But they needed to protest about insecurity, low pay, immigration and the lack of housing and the EU referendum was the nearest thing to hand.

It was fitting that the Republican presumptive presidential nominee of the Republican Party, Donald Trump, arrived in Turnberry on the very day that Britain turned its back on Europe. He seemed rather pleased that Britons had taken his advice to vote Brexit. Trump is the product of a very similar revolt of the underdogs. He has also exploited fears of immigration, shamelessly, in a country that used to celebrate it. He has attacked elite politicians like Hilary Clinton for being in the pay of the banks who busted the economy in 2008. He is plain-talking and politically incorrect – a down-market version of our own prime minister presumptive, Boris Johnson. We are entering an era of bad hair and bad politics.

Perhaps if Labour could overcome its own divisions and reconnect with the dispossessed and alienated, it could redirect some of this anger in a positive, progressive direction. But Jeremy Corbyn, decent lefty that he is, seems to be part of he problem rather than the solution. Certainly, the ex-Labour Brexit voters think he is just another product of the metropolitan intelligentsia, interested only in the welfare of black, minority and ethnic voters. The big story of Brexit is broken Britain – divided between London and the north; between elite and working-class; between urban and rural; between black and white; and – above all – between Scotland and England.

These are dark days. No wonder even some Scottish Unionists are now saying they wish they’d voted Yes.