The SNP is heading back into government after a dramatic night when the party made gains from Labour in several constituencies.

Nicola Sturgeon's party made a clean sweep of all the Glasgow seats - as the party did in last year's Westminster election - with Ms Sturgeon comfortably returned as the MSP for Glasgow Southside.

She hailed a "stunning" night and said the SNP had replaced Labour in the city.

The party made some significant gains from Labour as Kezia Dugdale's party faces electoral meltdown.

SNP rising star Ben Macpherson won a stunning 7000 majority in Edinburgh Northern and Leith.

Labour also lost Rutherglen and the Greenock and Inverclyde seats, which the party had held for the past 17 years, to the SNP.

The result in Rutherglen, which was the second of the night to be declared, saw Clare Haughey elected as the new MSP for the area, polling 15,222 votes, comfortably ahead of Labour's James Kelly on 11,479.

In Greenock and Inverclyde, Stuart McMillan won the seat for the SNP with 17,032 votes, easily beating Labour's Siobhan McCready on 8802 in second place.

Several of the SNP's ministers, including health secretary Shona Robison, justice secretary Michael Matheson, children's minister Aileen Campbell, schools minister Alasdair Allan and infrastructure secretary Keith Brown, were comfortably re-elected.

In her victory speech, Sturgeon said: "I want to thank the people of this great city of Glasgow. If you had told me when I was a teenager, starting out in politics, that one day the SNP would win every constituency in the city of Glasgow, not just in one election but in two elections, I would scarcely have been able to believe it."

She went on to thank "with great humility the people of Scotland for placing their trust in me and in the SNP".

Ms Sturgeon said: "There are many results to be declared this evening but what is now beyond doubt is that the SNP has won a third consecutive Scottish Parliament election.

"That has never been done before in the history of the Scottish Parliament. We have tonight made history."

Veteran Labour MSP Jackie Baillie held on to the Dumbarton constituency she has represented since 1999 but with a majority of just 109 over the SNP.

Labour enjoyed a rare gain from the SNP in Edinburgh Southern, where Daniel Johnson won the seat for the party.

Scottish Liberal Democrat leader Willie Rennie seized North East Fife from the SNP, prompting an overjoyed reaction from Tim Farron, who tweeted a cartoon of Mr Rennie on a slide.