The Nationalists, however, narrowly miss out on a majority but Nicola Sturgeon is likely to be able to govern on her own.
Victory for the SNP came at the cost of Labour which suffered a devastating defeat and came third in the poll north of the border.
A piece of good news for Labour was Sadiq Khan winning London's mayoral election to become the most senior Muslim politician in western Europe.
After a wait lasting more than six hours for the result, it emerged Mr Khan had taken 57-per-cent of the vote.
He referred to negative campaigning by his opponents in his acceptance speech.
Meanwhile, the Conservative Party is now the official opposition in Scotland taking 31 seats, an increase of 16 on 2011.
Christian and Conservative MP Alistair Burt, who is also a health minister, told Premier it had been a "bad night for Labour".
"For the Conservative party to hold its position so well in terms of council seats I think has been a perfectly fair night and rather good night for government after 6 years in place and a very difficult night for the Labour party," he said.
Labour lost 13 Scottish Parliament seats, including 11 to the SNP and two to the Conservatives.
Emma Reynolds, who resigned from the shadow cabinet after Mr Corbyn became leader, said the party should not be content with "standing still" when the Tories are in "disarray" and should have made significant gains.
Elsewhere, in a highly symbolic result, Labour lost the totemic Rhondda seat in the Welsh Assembly to Plaid Cymru leader Leanne Wood.
However Labour held on to two safe seats in Westminster by-elections and losses in English councils were less deep than some predicted.
The Conservatives lost overall control of Worcester Council but secured an absolute majority in Peterborough.
Ukip secured its first representation on the Welsh Assembly with wins in six regional list seats.
Suzanne Evans, a Christian and Ukip's Parliamentary spokesperson, told Premier it was "incredibly exciting, particularly in Wales".
"This really is a breakthrough for Ukip in Wales in particular because we've never had seats on the Welsh Assembly before.
"Our candidates ran an excellent campaign there and had a very strong manifesto".
John Mason, a Christian SNP politician, held onto his Glasgow Shettleston seat.
He told Premier: "I am obviously delighted, I think any politician is delighted to win an election and win a seat.
"It's been a slightly strange election because we were the favourites to win and I have seldom been in that position before. I have often been the underdog and won a seat we weren't expected to win."
"It is a mix, I accept that and we have lost some seats and lost some colleagues which is disappointing. I mean I think the big story is the move between Labour and the Conservatives that Labour is dramatically down in 3rd place and the Conservatives are dramatically up in second."
There was better news for Labour in Liverpool, where Joe Anderson was re-elected as mayor with more than 50% of the vote.
Jeremy Corbyn greeted reporters outside his house in Finsbury Park, north London, but did not comment on the election results.