Nicola Sturgeon and the Scottish National Party have won a fourth term in power at Holyrood, but they have failed to win an overall majority.

With all the seats declared – constituency and regional list – the SNP is on 64 seats, up one but one seat short of the decisive majority. The Conservatives secured 31 seats (no change). Labour closed on 22 (down two). The Greens, who will now do a deal with the SNP, are on 9 (up two) and the Libs Dems limped in on 4 (down 1).

In the constituency section the SNP took three seats from opposition parties. But tactical voting by pro-Union voters has been effective in denying the SNP wins in key battleground constituencies.

In Dumfriesshire, Conservative incumbent Oliver Mundell was returned with a thumping majority of 19,487 – nearly half the vote – a success reflected in a 14% drop in the local Labour vote.

That replicated what happened in Dumbarton on Friday evening, where Unionists also switched and there was a 6.1% boost in the Labour vote to secure a win for incumbent Jackie Baillie, Labour deputy leader. There was a 6.3% drop in the local Conservative vote.

In other areas where the SNP had hoped to win, the Green Party split the pro-independence vote: in Ettrick, Roxburgh and Berwickshire both parties made gains but not enough to dislodge the Tories.

And the Tories held Aberdeenshire West – which turned blue in 2016 –  with a 9.1% boost in their vote – enough to see off the 3.6% share increase for the SNP.

The Scottish election system reserves 56 of Holyrood’s 129 MSPs for the regional list, a second ballot that Scottish voters fill out separately. There are eight regions each with seven MSPs selected from the regional list.

The system uses the D’Hondt method – named after the Belgian lawyer who devised it – to regional vote tallies. The formula allocates these seats based on how well each party did in the constituency vote.

The system penalises those parties – like the SNP – which did well in the first round.

Opposition parties were nervous. There was a fear that the SNP could pick up an extra vote or two on the list and make it over the line.

In the end, the BBC prediction of 63, only one up from 2016, was out by only one seat.

With the Nationalist focus now on calls for a second referendum, there is a pro-independence majority guaranteed through an SNP alliance with the Green party. While the Greens failed to win any seats in the constituency vote, they made gains at the regional level.

Boris Johnson has already rejected calls for a second referendum. Number 10 will be emboldened now in saying that there is no mandate fo referendum before the next Scottish parliament electionn in 2026.

Inevitably, the SNP’s Angus Robertson, the new MSP for Edinburgh Central, sought to apply pressure on the PM today.

“If there is a majority for independence in this parliament, that is what should happen,” he told the BBC’s Kirsty Wark earlier, urging the PM to “respect democracy”.

Robertson is likely to be a candidate in a future SNP leadership race, if Sturgeon stands aside failing to have forced a referendum.

Despite the triumphant tone from the SNP in the run-up to these elections, the return on investment hasn’t quite materialised the way they expected. With only one extra seat, the party is not much better off on five years ago, and considerably worse off than its hey-day in 2011 when it won an overall majority under Alex Salmond.

Alex Salmond’s Alba plan to game the regional vote for an independence “supermajority” – with Salmond holding the balance of power – flopped too.