ALL eyes were on Aberdeenshire West.

In an election where a handful of seats held the key to an SNP majority, this was the last constituency standing in the party's way.

The Scottish Conservatives took it from the SNP in 2016, and by yesterday afternoon the Nationalists needed to win it back to keep the path to a majority open.

The SNP candidate, Fergus Mutch, must have been feeling the pressure.

"I got a message from the First Minister to say all eyes are on you – but this is just the sequence that the count's being done, it's not all down to you, don't worry about it," he said afterwards, laughing.

In the end, it wasn't to be.

Tory MSP Alexander Burnett retained the seat with a majority of 3,390, an increase on his slender lead of 900 in 2016.

Asked about stopping an SNP majority, Mr Burnett said: "There were a few comments about that which I'd seen on social media - I tried to stay away from it most of last night to do my nerves some good.

"I don't know the rest of the results but if a message has come out that this was a seat which stopped the SNP getting a majority then so much the better.

"I'm very, very proud of Aberdeenshire West being that seat."

Mr Mutch, the SNP's former communications chief, said he didn't think his campaign could have done any more than it did.

He added: "I kind of had a hunch from the last couple of weeks of the campaign that while it was going really, really well for us, and you could tell that, and our support was really, really motivated, you could tell the Unionist vote was consolidating around the Tories."

Earlier, the SNP had failed to take Galloway and West Dumfries, another marginal seat held by the Conservatives.

Finlay Carson secured a majority of 2,635 over the SNP's Emma Harper, up from his lead of 1,514 in 2016. Again, the signs pointed to tactical voting by supporters of the Union.

Ms Harper had caused controversy during the election campaign by claiming a border between Scotland and England resulting from independence could “create jobs”.

Mr Carson told the BBC he was "absolutely delighted" by the result, adding: "Our hard work over the last few months has paid off, and I'm honoured and privileged to be serving the people of Galloway and West Dumfries once again up in Holyrood."

Elsewhere, the SNP held on to its most marginal seat, Perthshire South and Kinross-shire.

This had been a key target for the Scottish Conservatives, who had hoped to take it from the Nationalists.

The result will have come as a relief to Jim Fairlie, the SNP candidate, who was standing in the seat after the party's Roseanna Cunningham decided to step down.

He previously told The Herald he was "very, very wary of taking anything for granted".

Laughing, he had added: "But you know, in all honesty, I don't want to be the guy that loses the seat after Roseanna Cunningham has held it for, including her Westminster career, 25 years."

After the strangest and potentially most important election in the history of devolution, the SNP won two seats from the Tories and one from Labour, making it the only party to make constituency gains.

The final result put it on 64 seats, the Conservatives 31, Labour 22, the Scottish Greens eight and Liberal Democrats four.

The SNP took East Lothian from Labour and Ayr and Edinburgh Central from the Tories, with the latter previously held by Ruth Davidson, who is now off to the House of Lords.

But one of the most dramatic results of the election came on Friday evening after an incredibly tense count in Dumbarton.

Previously Scotland's most marginal constituency, it was one of the SNP's top targets, but Labour's Jackie Baillie managed to increase her tiny majority of 109 in 2016 to 1,483.

Such was the elation within Labour, one party source compared it to a World Cup win.

Elsewhere, Scottish Tory leader Douglas Ross will return to Holyrood on the Highlands and Islands regional list as his party upped its number of MSPs in the area.

He was previously an MSP from 2016 to 2017, and is currently the MP for Moray.

Speaking after his election, Mr Ross said: "This region is so important to me - I have lived within the Highlands and Islands in Moray my entire life.

"I have had the great pleasure and privilege to represent this this area before and I'm delighted to be returned again to represent this diverse and wonderful part of Scotland."

Scottish Labour leader Anas Sarwar retained his seat on the Glasgow regional list as his party held four seats in the area.

He had challenged Ms Sturgeon in her Glasgow Southside constituency but failed to make a dent in her majority.

Meanwhile, Greens co-leader Patrick Harvie returned to Holyrood with his party having secured a record number of MSPs, including Lorna Slater, its other leader, representing Lothian.

The SNP won all nine constituencies in the Glasgow electoral region, with winners including Kaukab Stewart, Scotland's first female ethnic minorty MSP, who won in Glasgow Kelvin.

Other winners included Ivan McKee, Scotland's trade minister, James Dornan and John Mason.

Eight Glasgow constituencies were declared at the city's Emirates Arena, with the count for Rutherglen taking place in South Lanarkshire.

The SNP also won a clean sweep of the remaining Edinburgh constituencies yesterday.

After all votes were counted in the capital, the SNP had four seats, including Edinburgh Central, while Scottish Labour and the Liberal Democrats each held their seats, with every incumbent increasing their majority.

Speaking after her re-election as MSP for Edinburgh Eastern, the SNP's Ash Denham said "Westminster must listen" after a pro-independence majority looked set to return to Holyrood.

Ms Denham, who served as the community safety minister in the last Scottish Government, held her seat and increased her majority to more than 10,000.

Scottish Labour's Daniel Johnson held Edinburgh Southern and Liberal Democrat Alex Cole-Hamilton retained the Edinburgh Western seat with 25,578 votes - more votes than any other Holyrood candidate has ever received - giving him a majority of 9,885.

Elsewhere, Scottish Government minister Paul Wheelhouse failed to reclaim a seat in Holyrood.

Mr Wheelhouse - the energy and islands minister in the last parliament - lost his bid to take Ettrick, Roxburgh and Berwickshire from Tory incumbent Rachael Hamilton by 18,564 to 11,701 votes.

Gains in other parts of the South Scotland region harmed his chances on the regional list, with the SNP taking the East Lothian and Ayr seats.

Under Holyrood's voting system, winning constituencies in a certain region reduces the chances of a party also gaining seats on the corresponding regional list.

In the region, only Emma Harper was able to win a seat for the SNP, meaning MSPs Joan McAlpine and Mr Wheelhouse would not return.

In a tweet earlier in the day, Mr Wheelhouse appeared to accept his fate, saying he was hoping for the SNP to secure one list seat, but because he is third in the party's ranking it may not go to him.

"Not expecting it will be good news personally given the fact I am third, but still hopeful we get at least one list MSP elected to cover our area," he said.

Meanwhile, former Green MSP Andy Wightman also failed to attract enough votes to return to Holyrood an an Independent candidate.