Scots woke up today from a night of electoral chaos with no indication of who had won the most closely-contested election for years.
The SNP inflicted some serious blows on Labour but the overall pattern will not become clearer until later today.
Problems with a new electronic counting system being used for the first time in Scotland meant several counts were suspended until later today.
And as many as 100,000 votes may have been discounted across Scotland because they were classed as spoilt papers.
The problems caused widespread anger among politicians and led to demands for an inquiry.
Amid the chaos, there were some spectacular gains and losses.
Alex Salmond was re-elected to Holyrood in Gordon, where he ejected the Liberal Democrat's Nora Radcliffe and achieved a majority of 2,062.
He said in his victory speech: "There is a wind of change blowing through Scottish politics."
And he said it was "entirely possible" that Labour would have its lowest share of the vote in Scotland since 1922.
Deputy SNP leader Nicola Sturgeon scored a similar triumph in Glasgow Govan, where she captured the seat from Labour at the third time of trying.
The SNP also robbed Labour of Kilmarnock and Loudon, Central Fife, Dundee West and Stirling.
But in some areas Labour defied expectations.
Cathie Craigie held onto Cumbernauld and Kilsyth, while Elaine Murray increased her majority over the Tories in Dumfries.
While the SNP snatched Gordon from the Liberal Democrats, Nicol Stephen's party took Dunfermline West from Labour - but then the Tories snatched Roxburgh and Berwickshire from them.
Tommy Sheridan of Solidarity and Rosie Kane of the SSP both lost their Glasgow list seats, and Bashir Ahmad became Scotland's first Asian MSP, elected for the SNP on the Glasgow list.
But the overriding theme of the evening was the chaos surrounding the counting, and there were loud demands for an inquiry.
There were three separate issues.
In many areas, there were problems with the electronic counting machinery being used for the first time.
Separately from this, there were vast numbers of ballot papers rejected because the voters' intentions were unclear.
And Fergus Ewing said problems with postal votes had disenfranchised many.
Not only was electronic counting being used for the first time, but the public were also being asked to vote by the Single Transferable Vote (STV) method of proportional representation in the council elections being held alongside the Holyrood poll.
This required voters to list their preferences in 1-2-3 order, and many voters may have been confused by two ballot papers - one requiring them to use a cross, and the other requiring them to number candidates.
In Glasgow Baillieston, the rejected total of 1,850 was more than 10% of the total number of votes accepted.
And in some constituencies the number of rejected papers exceeded the majority of the winning candidate.
In Edinburgh Central, deputy environment minister Sarah Boyack had a majority of 1,193 but there were 1,501 rejected papers.
In Glasgow Govan, Nicola Sturgeon's majority was 744, but the number of rejected papers was 1,220.
Counting in Strathkelvin and Bearsden was suspended in the early hours and will resume at noon.
In Edinburgh, two seats were counted but the results in the remaining four will not be completed until later today.
SNP election director Angus Robertson said: "The winds of change are blowing through Scottish politics, and this election has a long, long way to go - not least because the SNP list vote is exceptionally strong.
"But the shambles at many counts, postal vote blunders and the number of spoiled ballot papers is disgraceful.
"The Scotland Office, Scottish Executive and Electoral Commission have to answer for bringing Scotland's democratic process into disrepute."
And Tory leader Annabel Goldie said: "As we predicted, the numbers of spoilt votes has dramatically increased as voters face two voting systems with three votes.
"In some seats the number of spoilt ballots has increased tenfold and on occasion is greater than that of the majority of the winning candidate."
Sonya Anderson, head of elections at DRS, the company behind the vote counting technology, told BBC Scotland: "We are having some known issues with the consolidation of results.
"We are working with those returning officers and our technical teams to get those results as quickly as possible.
"The e-counting system has not crashed. The system remains secure and robust with all audit information logged.
"This is a temporary interruption to one small aspect of the overall process."
Almost 10% of the votes cast yesterday could be invalid because the ballot papers were not filled in correctly.
Ken Ritchie, the chief executive of the Electoral Reform Society, demanded: "We need a full and open inquiry into why so many votes were spoilt in these elections."
He said the large number of spoiled ballots was not a consequence of the voting system used for Holyrood, pointing out the number of spoiled ballots in 1999 was less than 1%.
He also said the electronic counting was not to blame either - although he conceded there had been "teething problems" in some areas.
Dr Ritchie added: "It is not the equipment that has caused people to make mistakes in the completion of their ballot papers."
He explained this year there were two major changes. Previously, voters had separate ballot papers for the regional list vote and the constituency vote at Holyrood, but this time there was only one paper, which was split into two columns.
In addition, the poll for the Scottish Parliament elections, in which people marked their choice of candidate with a cross, was held at the same time as the council elections which used the single transferable vote system, in which voters number candidates in order of preference.
Dr Ritchie said: "It is possible that holding two elections with very different voting systems on the same day was a mistake.
"Holding future elections on different days is an option that must be considered."
But he warned against knee jerk reactions to the chaos and added: "Only when we understand what has gone wrong will we be in a position to determine what must be done to ensure that we never see this level of spoilt papers again."Reuse content