It surely just could not happen. After all, on balance the opinion polls pointed to a majority vote to remain. The economic arguments against Brexit were overwhelming. And virtually anybody who was anybody was backing Remain. Surely, the good ordinary people of Britain would eventually see sense.
But out there in provincial England that was not how they saw things.
They did not like being told that they had no choice but to accept the consequences of an EU membership whose economic benefits were not obvious to them but whose implications for the level of immigration were all too apparent. For it was England – beyond the capital, and especially that north of the M4 – where the Remain’s side fate was sealed.
From the very first declaration in Newcastle, the omens for it were inauspicious. Gradually it became clear that throughout the Midlands and the North of England the Remain side’s performance was consistently below what it needed locally if it was going to be ahead across the country as a whole.
Only in London (and even then, for the most part, only in inner London) was Remain recording the kind of performance that it needed to secure a clear win across the country.
Meanwhile, both in Scotland and in the South of England, it could little more than achieve what was needed for a draw.
As a result, London, as the only part of England to vote for Remain, now looks isolated from the country of which it is meant to the capital. Northern Ireland, which also voted to Remain, finds itself with the unwanted risk of discovering that the border with the Republic comes to matter much more than hitherto.
But it is in Scotland, where as many as 62 per cent voted in favour of Remain, that the reverberations will be felt most immediately. For many a SNP supporter, the prospect of being forced to leave the EU as a result of votes cast in England vividly demonstrates just why their country should be independent. What will now be keenly watched is whether their fellow citizens come to share the same view.
There was also a serious social divide. On the one hand there was a highly qualified Britain that feels able to compete in an international labour market and is comfortable with the cultural diversity that comes with immigration. On the other hand, there was a left-behind Britain that has not enjoyed the privilege of an advanced education, feels economically squeezed, and is challenged by the social changes that come with immigration.
In local authorities with relatively high proportions of graduates, Remain won on average as much as 58 per cent of the vote. In contrast in those areas with relatively few graduates, just 39 per cent backed remaining. Oxford and Cambridge voted firmly to Remain, Boston and Basildon equally determinedly to Leave.
Not that this pattern meant that Remain always did particularly badly in Labour voting areas. At 47 per cent, the average level of support for Remain in places where Labour won more than 39 per cent of the vote at last year's general election, was little different from the equivalent figure (48 per cent) in those places where Labour won more than 39 per cent last year.
It was perhaps all a little too convenient for some disappointed Tory supporters of the Remain cause to blame Jeremy Corbyn for their side’s defeat rather than focus on the inability of their own leader to win the country around.
It is certainly the Conservative Party that faces the most immediate challenges. The referendum split the parliamentary party in two, as it did too its support in the country. Now it is going to have to find a new leader against a most inauspicious backdrop. Whether Cameron’s successor can bring the party back together and so command a majority in the House of Commons is far from certain.
In the meantime, perhaps our politicians’ recent enthusiasm for referendums will now be cooled. Cameron gambled in Scotland and came uncomfortably close to losing. Now he has come unstuck after trying the same trick twice. The trouble with asking the people what they think is that they may not come up with the answer you were expecting.
John Curtice is professor of politics at Strathclyde University
Join our new commenting forum
Join thought-provoking conversations, follow other Independent readers and see their replies