A huge SNP effort to get their supporters to polling stations cancelled out a rise in unionist tactical voting in key constituencies as the first tranche of results in the Holyrood elections were announced.
Turnout surged across the country despite the pandemic – rising by more than 10 percentage points in some seats compared to 2016 – with a record number expected to have participated in a Scottish Parliament vote.
The nationalists were determined to avoid a repeat of the 2017 general election, when SNP voters staying at home was seen to have contributed to surprise gains for Labour in urban areas and Tories toppling nationalists in parts of rural Scotland.
The SNP bombarded its supporters with texts and emails addressed from Nicola Sturgeon on election day, urging them to vote and also to ensure that at least five friends or family members also made it to polling stations.
On Friday, Scottish Tory strategists admitted that the success of the SNP drive to get out the vote had neutered their attempts to gain seats by encouraging widespread tactical voting among unionist voters determined to stop a second independence referendum.
"This is a good example of our problem," a Scottish Tory source said following the declaration of John Swinney's seat in Perthshire North just before 2.30pm. "Our vote is up a good share, but the SNP were up higher."
Murdo Fraser, the Tory challenger to Mr Swinney, had increased his vote by 2,617 compared to 2016. However, Mr Swinney's vote went up by 3,334, meaning he was returned with an increased majority.
In Ayr, represented by John Scott for the Tories since 2000, the Conservative tally rose by 2,528. However, the SNP won 3,448 more votes than in 2016, allowing it to claim the seat with a majority of just 170.
Elsewhere, pleas for unionists to engage in large-scale tactical voting were more successful. In Edinburgh Western, the Lib Dem Alex Cole-Hamilton saw his vote increase to 25,578, resulting in a majority of almost 10,000 over the SNP candidate. Willie Rennie, the Lib Dem leader, doubled his majority in North East Fife.
But in other parts of the country, increased vote shares for unionists were countered by the SNP's successful efforts to encourage their supporters to the polls.
"Scotland needs you," people on SNP databases were told by email at 8am on Thursday, just an hour after the polls opened.
In a 6pm email, Ms Sturgeon urged supporters: "Please help me today by doing everything you can to get the SNP vote out. The next four hours will decide Scotland's future. If we all contact five friends or family, collectively we can reach over 750,000 voters."
SNP supporters in marginal constituencies also reported receiving three text messages, from party headquarters, the local candidate and their regional party branch, urging them to get friends and family to polling stations.
In East Lothian, Scottish Labour was initially cautiously optimistic about holding onto a seat that Iain Gray, the former party leader, had held since 1999. The party's vote increased by 2,460, to 16,789, but the SNP vote rose by 4,766 to 17,968, meaning a nationalist majority of 1,179 as one of Labour's last bulwarks fell.
The SNP gains in Ayr and East Lothian – both in the South of Scotland region – could yet be rebalanced by nationalist losses on the regional lists, with those results to be announced on Saturday.
A "small number of votes in a small number of seats" would decide whether or not the nationalists won a majority, Ms Sturgeon said as the results rolled in. The First Minister comfortably held her Glasgow Southside constituency, with Labour's Anas Sarwar making only the smallest of dents in her majority of around 9,500.