The Scottish National Party has broken Labour's eight-year dominance of the Scottish Parliament.
The SNP has emerged from the election with 47 seats, one more than its rival. The Tories ended up with 17, the Lib Dems with 16 and the Greens two.
Independent Margo MacDonald was returned to the new parliament.
Speculation is now rising about an SNP/Lib Dems/others coalition but a stumbling block could be the Nats' plans for an independence referendum.
The Liberal Democrats have said they are opposed to a referendum.
The results came after a night of high drama, which saw the polls hit by major problems.
Seven counts were suspended amid claims that voters had been confused by the ballot papers and the decision to hold the local authority elections at the same time.
The Nationalists made significant gains, including Mr Salmond winning in Gordon and his deputy Nicola Sturgeon taking Glasgow Govan.
In an address aimed at setting out his credentials as a first minister in waiting, SNP leader Alex Salmond said on Friday afternoon that Labour Party had "lost the moral authority to govern Scotland".
"Scotland has changed for good and forever," he declared.
"There may well be Labour Governments and Labour first ministers in the decades to come but never again will we see the Labour Party assume that it has a divine right to rule Scotland.
'Snap decision'
"Labour has no moral authority left to govern Scotland."
Scottish Labour leader and current First Minister Jack McConnell pledged to "keep all options open" on how to go forward from the knife-edge outcome of the election, indicating he would not rush into any hasty coalition decisions.
"I have not spent the last five-and-a-half years of my life as first minister building up Scotland and improving this country to make a snap decision this weekend about the future of our country, a decision that could affect every family across Scotland," he said.
"Having fought an election campaign to put a strong economy, the foundation of our work - the education service - as our national priority, and action of crime and anti-social behaviour as fundamental, it is right and proper this weekend that I and my party reflect on how best to take forward these priorities in government and the parliament again."
Under the Scotland Act, a new first minister has to be appointed within 28 days of the election, making the deadline 30 May.