Nicola Sturgeon's hopes of winning an overall majority for the Scottish Nationalist Party at the Holyrood election are hanging in the balance - despite the First Minister's party making gains from its rivals.
The SNP picked up key seats in Edinburgh Central - where former SNP Westminster leader Angus Robertson replaced the one time Scottish Tory boss Ruth Davidson - as well as as in Ayr and East Lothian.
But under Holyrood's proportional representation system, those successes could see it lose seats on the regional list ballot.
Meanwhile, Labour's Jackie Baillie held on to her Dumbarton constituency - which had been the most marginal seat in all of Scotland and a top target for the SNP.
Ms Baillie had a majority of just 109 from the 2016 Scottish Parliament election, but increased that to 1,483.
With some constituencies still to be counted on Saturday, when the crucial regional list results will also be declared, Ms Sturgeon said it was "not impossible".
The coronavirus pandemic meant traditional overnight counts were abandoned after Thursday's Scottish Parliament election.
And while the majority of the 129 MSPs at Holyrood have still be declared, Ms Sturgeon said it was "almost certain" the SNP would win its fourth term in power at Holyrood.
She also stressed that "when the time is right", she should be able to offer Scots "the choice of a better future" in a second independence referendum.
Ms Sturgeon, who comfortably defeated Scottish Labour leader Anas Sarwar to claim Glasgow Southside, said afterwards: "My focus, if we are re-elected as the government, is to get back to work to steer the country through the crisis and into recovery.
"That remains the case. But once the crisis is over, and if there is a majority in the parliament for an independence referendum, people should have the right to choose our future.
"Scotland's future should always be in Scotland's hands."
Speaking about the prospect of winning an overall majority, the SNP leader said: "It's certainly not impossible, but nor is it guaranteed.
"That was always going to be on a knife edge, it comes down to a small number of votes in a small number of seats.
"So at this midway point it is certainly still there as a possibility, but I have never taken that for granted.
"It is a long shot, to say the least, in a PR system, to win a majority, you effectively have to break the system. I would like to do it, but I have never been complacent about that."
As he secured his Perthshire North seat, Deputy First Minister John Swinney said the SNP would be the "leading and largest party" in the new Scottish Parliament.
Elsewhere, former first minister and Alba Party leader Alex Salmond said the measure of his party's success would be "our existence as a political party", adding it is "here to stay".
Meanwhile Welsh Labour looks set to win the Senedd election after the party fought off challenges from the Tories to key red wall seats in North Wales.
Labour First Minister Mark Drakeford said his party had "exceeded expectations" to end Friday's constituency count with 26 seats, three short of the number held in the last Welsh Parliament and five short of a majority.
The results of the Senedd's 20 remaining regional seats are set to be announced on Saturday, with coronavirus restrictions at count venues having slowed down the process.
Meanwhile, the Welsh Conservatives have eight seats, including taking Vale of Clwyd from Labour, and Plaid Cymru have five having lost former leader Leanne Wood's Rhondda seat to Labour.
Labour declared its strong Senedd election performance as "an extraordinary set of results in extraordinary times" with the party favourite to retain control of the Welsh Government.
Polling at the start of the campaign suggested Labour was facing its worst ever result and was at risk of winning as few as 22 of the Senedd's 60 seats, a loss of seven from 2016, though later polls suggested a stronger showing.
After voting closed at 10pm on Thursday, party sources said retaining all of its seats in the Senedd remained "a massive challenge".
Mr Drakeford, who extended his majority for his Cardiff West seat by more than 10,000 votes, said he was delighted his party had "exceeded expectations".
Asked if he believed he was on course to winning a majority, Mr Drakeford said: "No party has ever won a majority in the Senedd. It's very hard to find those extra couple of seats.
"But we will be far closer to it than I think anybody imagined we would be.
"I will want to sit down tomorrow when we have a full suite of results in front of us to think about how we can achieve what we need here in Wales, which is a stable and progressive government."