The SNP will form a historic third term government but have fallen short of an overall majority.

With all results declared, the party have won 63 seats, leaving them two short of a majority.

The Scottish Conservatives have won 31 seats, having benefited from a rise of 8% in their constituency vote from the party's 2011 results, winning seven constituency seats.

Labour won 24 seats in total, only three of which came from constituency seats.

The Greens are sitting at six seats, while the Liberal Democrats have won five. The Lib Dems took all of their seats bar one on the constituency vote, while the Greens won all of theirs on the regional vote.

UKIP failed to win a seat. UKIP leader David Coburn missed out on a list seat in the party's target region of the Highlands and Islands.

In a number of constituencies the Nationalists polled more than 50% of the vote. The party gained 11 seats from Scottish Labour, whose vote declined nationally by 9% from the previous election.

Ahead of the Glasgow count Nicola Sturgeon told reporters she was "expecting to have a stunning night here in Glasgow" and that "we're not so much beating Labour as replacing them.

She added: "At this stage I'm expecting a very good night."

Such was the party's advance it won every constituency in Glasgow, North Lanarkshire and South Lanarkshire. These areas were once Labour strongholds.

Further bad news for Scottish Labour came in Eastwood, where sitting MSP Ken Macintosh finished third, while the Scottish Conservatives' Jackson Carlaw won the seat - one of the Tories' top targets.

Commenting afterwards, the defeated Labour candidate said that the last 18 months have been bad for the party.

Macintosh said: "The Labour party has had a very difficult time since the referendum. I think we are starting to win the arguments but we aren't winning the votes."

He was later elected from the regional list.

Welcome news for the Labour party came in the form of former leader Iain Gray holding on to his East Lothian constituency and Jackie Baillie similarly in Dumbarton.

The party was able gain one seat from the SNP with Labour candidate Daniel Johnson victorious after the votes were counted.

Scottish Conservative leader Ruth Davidson had an unexpected win in Edinburgh Central.

She topped the poll with more than 10,000 votes.

The Tories held off a challenge for their Ayr seat from the SNP, holding it with an increased share of the vote.

They then went on to win the Aberdeenshire West from the SNP.

There has also been good news for the Scottish Liberal Democrats, with party leader Willie Rennie gaining the North East Fife seat from the SNP.

The party also took Edinburgh Western from the SNP and held off the SNP's advance in the Northern Isles by retaining both the Orkney and Shetland constituencies.

Liam McArthur held Orkney for the Lib Dems with an increased majority. His party polled 66.5% of all votes in the area with a swing of 16%. Meanwhile, former Lib Dem leader Tavish Scott will make a return to Holyrood after winning Shetland.

The party won their only list seat in the final declaration of the election, the North East region.

The Scottish Greens have also made gains, tripling the number of seats they won in 2011 to six.

They claimed two list seats in the Lothian region, one in Mid-Scotland and Fife, one in Glasgow, one in the Highlands and Islands and one in the West of Scotland.

Co-convener Patrick Harvie came second to the SNP in the Glasgow Kelvin constituency but won a seat on the Glasgow list. However, the party's other co-convener Maggie Chapman lost her seat in the North East region.

Ballot papers were issued to 4,099,547 registered voters across the nation.

This is the fifth Scottish Parliament election since it was reconvened in 1999.