Well, that came as a surprise, certainly to me. My meticulously calibrated model proved almost as bad at gauging public opinion as Theresa May. Yesterday in Edinburgh I dropped into Ladbrokes on Nicolson Street. There were large pictures of Corbyn and May in the window; all the punters inside were scanning the racing pages. I looked at the prices on the betting machine and the shortest odds (10/3) were on the Tories’ getting 351 to 375 seats. I thought better of putting a tenner on.

The extent of May’s failure can hardly be exaggerated. A purely opportunistic election has blown up in her face. She has managed to lose seats like Canterbury which previously had a 10,000 majority. She had allowed her head to be turned by polls that suggested the Tories were 20 per cent ahead of Labour. Having taken the electorate for granted, she then conducted a disastrous campaign. The one big policy idea in the manifesto, the dementia tax, managed to leave people thinking that she planned to grab their homes to pay for their care. She failed, into the bargain, to capitalise on the one big unpredictable of the campaign, namely the atrocities in London and Manchester, which should have played to the Tories’ perceived strengths. She’s ended up squandering the narrow majority they had in the last parliament.

May’s failure of judgment is egregious. She called the election to get a mandate that would supposedly strengthen her hand in the Brexit negotiations and has contrived the precise opposite. May and Lynton Crosby’s strategy relied on her being a one-trick pony – one which, however stolid, was at least sturdy enough to be relied on to carry the nation towards Brexit, talks on which (as May kept saying in the campaign) start in ten days’ days. Now the pony remains only to be canned and fed to the dogs.

May has said that she is going on. It is no longer her call: over the weekend, pressure will build for her to go – not least because there may well be another election before long and it is unimaginable that she would be entrusted with leading the party into it. In her victory-defeat speech in Maidenhead, May was still banging on about stability. Her position is vastly weakened, and not only with her own party. Without the 12 Tory gains in Scotland her position would be still worse, and those gains owe very little to May. More important, her authority to conduct the Brexit negotiations is shot, as the EU’s people will have already noticed.

By the same token, Corbyn and Labour’s achievement is immense. Labour is currently projected to win 40 per cent of the vote, a full twelve per cent higher than its share in the 2015 election under Ed Miliband, and the same as when Blair won in 2001, and higher than 2005. So much for Corbyn’s being unelectable. He’s weathered personal vilification and a sustained campaign of sabotage within the parliamentary party. This is the death-rattle of new Labour. When the election was called and it seemed clear that the Tories would romp home Peter Mandelson went on Newsnight to say that Corbyn would have to own the result. Blairites will have to suck it up.

Brexit never really got started as a campaign issue. Labour’s performance is partly the result of taking a good many votes, though fewer than the Tories, from Ukip’s collapse. Corbyn’s strategy of parking the issue, to avoid alienating either Labour's working-class Leave voters or middle-class Remain supporters, has largely worked. Despite some early responses to the results, there is not much cheer in them for Remainers. England and Wales have been dominated by the two main parties, both of which endorse Brexit. Even in strongly pro-Remain Scotland, the SNP shed seats to the Tories, whose campaign solely against a second independence referendum paid off; even beleaguered Scottish Labour managed a net gain of five seats. The substantive issue that played well for Labour was resistance to austerity, with a credible plan based on modest deficit finance.

In the shorter term, the Tories will presumably form a coalition with the DUP as a regressive alliance with about 328 seats. Since Sinn Féin (with 7 MPs) don’t take their seats, the effective majority line is likely to be 322. When May goes, various candidates will pitch themselves forward – with, all the while, the EU awaiting the start of the Brexit negotiations and another likely election in the offing. Before that the country will find out what rough beast – probably Boris Johnson – is slouching towards Brexit to be born.