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.
Initial results showed the SNP was on course to win a fourth consecutive term in office having triumphed in 38 of the 47 seats declared so far, winning three key battlegrounds in the process.
But in some areas there was an increase in support for opposition pro-union parties, indicating the final outcome would be very close. The final results will be announced later on Saturday.
The electoral system - which allocates some seats on a proportional representation system which helps smaller parties - might see the SNP fail to win an outright majority, something First Minister Nicola Sturgeon, the party leader, acknowledged.
"It would be good to do. But I have never taken that for granted and it has always been on a knife edge," she said.
There is likely to still be a pro-independence majority even if the SNP fall short because of the Green Party, which also supports secession. But supporters of the union argue that without an SNP majority, there is no mandate for a referendum.
The outcome of the election could therefore ultimately put Scotland on the path towards breaking its 314-year union with England and Wales. Scottish politics has been diverging from other parts of the United Kingdom, but Scots remain divided over the prospect of another polarising independence vote.
"Irresponsible and Reckless"
Britain's exit from the European Union - a move 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 polls suggest the outcome of a second referendum would be too tight to call.
Johnson, who the British government says must approve any vote for it to be legal, has made clear no such approval would be forthcoming.
"I think a referendum in the current context is irresponsible and reckless," he told the Daily Telegraph newspaper.
Sturgeon herself has ruled out holding any vote until after the Covid-19 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 a vote.
"We've said that we will take forward the legislation ... to have a legal referendum," Deputy First Minister John Swinney told BBC TV.
"We already have put in place some of the legislative arrangements for that process, and we will embark on such an agenda should there be a majority for such a proposition in the Scottish parliament."
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.