A dramatic night of general election results in Scotland, which saw former first minister Alex Salmond lose his seat, has raised questions over the future of the SNP and the prospect of Scottish independence.
In one night the SNP lost 21 of the 56 seats it won in 2015 while the three main pro-UK parties each inflicted shock defeats on Nicola Sturgeon's party.
The Scottish Conservatives surpassed their expectations to win 13 seats. The Scottish Labour party – previously thought to be in terminal decline – gained six, and even the Liberal Democrats won three previously SNP seats.
Sturgeon has already conceded she will be forced to "reflect" on whether the devastating results – which also saw deputy leader Angus Robertson lose his seat – will lead her to put the brakes on another independence referendum.
The SNP's vote share fell by over 13% from its 2015 performance and party insiders have started to ask questions on Friday morning about how the leadership and local branches failed to detect such a widespread decline in support during the campaign.
While Sturgeon said she was pleased the SNP had won the election in Scotland with a majority of the possible 59 seats, she admitted she was "disappointed" with the party's losses and said independence was "a factor" in the defeats.
An SNP source said: "The scale of reversals flies in the face of all [our] breathless self-congratulation. I'm concerned a lot of our organisation doesn't know what it's doing if we didn't see it. I didn't go to umpteen seats because I was told they were fine."
One insider suggested that the first minister – who was previously thought to be untouchable – will now face "questions" over her leadership alongside the role of her husband, Peter Murrell, who is the party's influential chief executive.
The Scottish Conservatives' result matched the highest expectations of some of their most optimistic members during the campaign, but the scale of the vote swing towards them throughout Scotland was remarkable.
In almost every seat in Scotland, Ruth Davidson's party saw its share of the vote increase, and the scale of her victories north of the border, despite setbacks down south, saw the Scottish Tory leader declare: "IndyRef2 is dead."
Scottish Labour, meanwhile, surprised even themselves by gaining six seats in an election where they would have been quietly happy to retain the one seat they won at their terrible election night in 2015 – Edinburgh South.
Early indications show there was a "Corbyn bounce" for the party, which won a total of seven seats, leading the re-elected MP for Edinburgh South, Ian Murray, to tell the audience at the Edinburgh count: "The Scottish Labour party is back."
Scottish Labour leader Kezia Dugdale said the SNP vote was "crumbling in their heartlands" and that voters had been persuaded to come back to her party with the help of "Jeremy Corbyn's anti-austerity message".
The campaign coordinator for the Scottish Lib Dems, Alex Cole-Hamilton MSP, told BuzzFeed News: "Tonight's results show that not only are the Scottish Liberal Democrats back, but we're on the march as well.
"Despite gloomy predictions and difficult polls throughout the campaign, we've demonstrated once again that we can defy political gravity and return hard-working, community-focused parliamentarians across Scotland."
Summing up, one SNP source said: "We've lost some great colleagues, and it's clear we have a lot of thinking to do – but we'll regroup and make sure that we do all we can to protect Scotland from another round of Tory cuts."
Jamie Ross is a Scotland reporter for BuzzFeed News and is based in Edinburgh.
Contact Jamie Ross at email@example.com.
Got a confidential tip? Submit it here.