The Scottish National Party (SNP), which has vowed to hold an independence referendum that could tear the United Kingdom apart should it be returned to power, will find out on Saturday if it has won a majority in Scotland's parliament.
The SNP says it will seek to hold a new vote on secession if a pro-independence majority is returned to the devolved 129-seat parliament. This would set up a clash with British Prime Minister Boris Johnson, who says he will refuse any such vote because Scots backed staying in the United Kingdom in 2014.
Results showed the SNP on course for a fourth consecutive term in office having triumphed in 47 of 56 seats declared so far, including in three key battlegrounds.
There were signs of some tactical voting by supporters of pro-union parties, meaning an outright SNP majority could be a close-run thing. Final results are due later on Saturday.
The electoral system - which allocates some seats on a proportional representation basis which helps smaller parties - might see the SNP fail to win an outright majority, something First Minister Nicola Sturgeon, the party leader, acknowledged, saying such an outcome was "on a knife edge".
There is likely still to be a pro-independence majority even if the SNP fall short because the Green Party also supports secession. But supporters of the union argue that without an SNP majority, there is no mandate for a referendum.
Scottish politics has been diverging from other parts of the United Kingdom for some time, but Scots remain divided over holding another vote on whether to end their country's 314-year union with England and Wales.
'Irresponsible and Reckless'
Britain's exit from the European Union - opposed by a majority of Scots - as well as a perception that Sturgeon's government has handled the Covid-19 crisis well, and antipathy to Johnson's Conservative government in London, have all bolstered support for Scotland's independence movement.
Scots voted by 55%-45% in 2014 to remain part of the United Kingdom, and Johnson says that was a "once in a generation" vote. Polls suggest the outcome of a second referendum would be too tight to call.
The British government says Johnson must approve any vote for it to be legal and he has made clear he will not do so.
"I think a referendum in the current context is irresponsible and reckless," he told the Daily Telegraph newspaper.
Sturgeon has ruled out holding any vote until after the pandemic, with the SNP indicating it would be held by the end of 2023. She argues there would be no moral or democratic justification for Johnson to refuse a referendum if the Scottish parliament passes a bill to hold one.
"The results are looking like what we expected, that with the Scottish Greens there will be a pro-independence majority in the Scottish parliament and we take that as a clear mandate from the Scottish people to hold another referendum," Lorna Slater, co-leader of the Scottish Greens, told the BBC.
"I think Boris Johnson doesn't want a referendum because he knows he's going to lose."
With Sturgeon ruling out holding an illegal or wildcat plebiscite, it is likely that the issue will ultimately be decided by Britain's top court.
Responding to a suggestion the matter would end up before judges, Sturgeon wrote on Twitter: "Only if the Tories (Conservatives) refuse to accept Scottish democracy and go to court in an attempt to overturn it - which seems rather an important point of context."