The Scottish National Party went into this general election with losses predicted from their record 56-seat haul in 2015, but even the nationalists' fiercest critics could not have envisaged such a difficult night for Nicola Sturgeon's party. The SNP saw its vote share drop sharply as the party lost 21 seats across Scotland.
A number of SNP big beasts were defenestrated, including former first minster Alex Salmond and deputy leader Angus Robertson. The result – which Sturgeon described as "disappointing" – raises serious questions about whether the SNP will push ahead with its pledge to hold a second referendum on independence.
Placed against the history of Scottish nationalism, this election result could be read as a success. The SNP won 35 seats, by some distance the party’s second best ever performance in a Westminster vote. The nationalists still hold more seats than all their unionist rivals combined.
But given the scale of the SNP’s recent triumphs, Thursday’s vote was a sizable setback for a party unused to such hindrances. For the past decade, the SNP has been able to claim victory in just about every electoral contest it has fought.
Three successive elections to the devolved parliament in Edinburgh have been won. Even defeat in the 2014 independence referendum turned into success, as more than 100,000 new members joined the SNP, paving the way to winning all but three of Scotland's 59 seats in the following year's general election.
This time around, however, it is harder to see the silver lining for Scottish nationalism.
Trouble in the heartlands
The SNP suffered losses in what were, until very recently, heartlands, particularly in rural Scotland. Of the six seats the nationalists won in the 2010 general election, four were lost, including Eilidh Whiteford's, who saw a near 15,000-strong majority in Banff and Buchan overturned by the Conservatives' David Duguid.
In a curious reversal of 2015, when the SNP took 40 Scottish seats including those of former cabinet ministers, name recognition appeared to have little bearing on constituency results. Westminster leader Angus Robertson in Moray and Salmond in Gordon were both unceremoniously unseated.
In Perth and Perthshire North, a seat the SNP has held since 1997, Pete Wishart held on by just 21 votes. In North East Fife, Stephen Gethins, one of the SNP's strongest performers in Westminster over the past two years, scrapped back into parliament with just two votes to spare.
While the SNP did hold most of the seats won in 2015, almost all saw significantly reduced majorities. Even effective media performers such as Mhairi Black and Tommy Sheppard were left with unexpectedly nervous waits to confirm their seats.
Remarkably, a disastrous night for the Conservatives in England was just about salvaged by the performance of the Tories' Scottish wing. Having gone into this election with just a single seat, the Scottish Conservatives emerged with 13, the party's best result since 1983.
The Tories' success reflected not so much confidence in Theresa May's government – the prime minister is the least popular political leader in Scotland – as the desire of a significant section of the Scottish public to avoid a second independence referendum. Adam Tomkins, Conservative member of the devolved Scottish parliament for Glasgow, described the election as "a good night for the union".
Certainly, this general election makes the prospect of an independence referendum in the near future far less likely. In March, Sturgeon won a vote in the Scottish parliament to have the powers to hold another vote on leaving the UK when the terms of the UK’s Brexit deal are known. On Friday, the first minister hinted that this timetable might be changing.
Brexit’s role
Brexit has not altered the dynamics of Scottish independence anywhere near as much as seemed likely almost a year ago, when a majority of Scots voted to remain in the European Union. Most Scots seem to be milquetoast Europhiles, far more committed to the union with England than that with Europe.
But the SNP’s support for independence was not the only factor in its election travails. After 10 years in power in Edinburgh, the nationalists found themselves increasingly called upon to defend their record on issues such as education and the state of the Scottish health service during the campaign.
The SNP struggled to articulate an effective campaign message. Sturgeon, once seen as such an asset to the nationalist cause, has become an increasingly divisive figure, with polls showing falling approval ratings for the first minister.
Labour, presumed to be dead and buried in their one-time Scottish strongholds, performed surprisingly well. The party increased its vote share, gaining half a dozen seats, many with a significant left-wing, pro-independence vote. After the Corbyn surge and the Conservative revival, the Scottish political map does not look as different to the rest of the UK as it did at the start of this general election campaign.