AS far as political drama goes, it was a day that saved the best for last.

The results started slow and then built to a dramatic climax in what was Scotland's most marginal constituency.

Dumbarton, held by Labour's Jackie Baillie with a tiny majority of just 109 in 2016, was one of the SNP's top targets going into the election.

Nicola Sturgeon's hopes of an overall majority depend largely on a handful of opposition-held seats with slim majorities, and they didn't come any slimmer than this.

Speaking to broadcasters, Ms Baillie had called the result "too close to call", while rumours of recounts filled social media.

But in the end Ms Baillie saw off her SNP challenger Toni Giugliano with an increased majority of 1,483.

Following a day of some disappointment, Labour politicians and staffers erupted in celebration.

"I have quite a lot of beer over me," one told The Herald shortly after the result was declared.

Professor John Curtice, Scotland's foremost polling expert, explained the ramifications of the result.

He told the BBC the SNP still have a pathway to an overall majority, but "it's a very, very narrow one".

Key constituencies such as the Conservative-held Galloway and West Dumfries and Aberdeenshire West have still to declare.

The SNP could also secure a seat on the regional list in the Highlands and Islands, he said.

But the most probable outcome, Mr Curtice explained, is that the SNP will fall short of an overall majority, leaving the role of the pro-independence Greens once again crucial.

Earlier, the SNP had picked up three of the key seats the party was hoping to take.

East Lothian was the first seat to change hands as the SNP seized it from Scottish Labour with a majority of 1,556.

The constituency had been Labour's since the dawn of devolution and its candidate, Martin Whitfield, was a former MP for the area.

The disappointment in the Labour ranks was palpable, and there was anger over the Conservatives taking pro-UK votes.

"East Lothian is disappointing, but it is a direct result of the Tories' reckless campaign, which has increased the chances of an SNP majority," one party source said.

The next key change was Ayr, which the SNP took from the Tories with a majority of just 170.

Tory candidate John Scott had been the MSP for the constituency since a by-election in 2000.

Later, former SNP deputy leader Angus Robertson won Edinburgh Central, the seat formerly held by ex-Scottish Conservative leader Ruth Davidson, who is heading to the House of Lords.

Mr Robertson reversed the majority of 810 held by Ms Davidson, winning 16,276 votes.

The Tory candidate, Scott Douglas, won 11,544 votes, giving the SNP a majority of 4,732.

Speaking after taking the seat, Mr Robertson said: "In this most European of capital cities, people have resoundingly rejected the party of Brexit and Boris Johnson.

"The public has rejected all of the parties that want to block an independence referendum."

He added: "This result is an emphatic and an unparalleled victory for the SNP in Edinburgh Central.

"We have just won the seat of the former leader of the Scottish Conservatives and recorded the best ever SNP result."

He said voters had said "Scotland's future should be in Scotland's hands".

Mr Robertson, who is also the party's former Westminster leader, is a key ally of Ms Sturgeon and could be in line for a top role in her Government.

But the SNP failed to take Eastwood, where another ex-Tory leader, Jackson Carlaw, increased his majority to 2,216.

The Tories' Oliver Mundell also held on to Dumfriesshire, while Labour's Daniel Johnson saw off the SNP in Edinburgh Southern, another key marginal.

Coronavirus has made this an election like no other, with no overnight counting, half-empty venues and candidates wearing masks.

After Richard Lochhead held his Moray seat for the SNP, he had to join the result declaration remotely using a videolink because he is self-isolating.

But despite the pandemic, turnout was higher than anticipated, leading to speculation over how it could affect the outcome.

The first result to be declared in the early afternoon was Orkney, where Scottish Liberal Democrat Liam McArthur held on for Willie Rennie's party.

Later, Mr Rennie insisted "now is not the moment" for another Scottish independence referendum as he held his own North East Fife seat.

He won 22,163 votes, compared to SNP candidate Rhuaraidh Fleming, who took 14,715.

Speaking after the result, Mr Rennie said: "I hope all the candidates in this election hear the message from the voters that now is not the moment for another referendum.

"We need to listen to that."

But the Liberal Democrats failed to take Caithness, Sutherland and Ross from the SNP, despite hopes of a breakthrough.

Elsewhere, there was some early drama when the SNP's majority collapsed from 6,583 to just 772 in Banffshire and Buchan Coast, Scotland's Brexit heartlands.

Meanwhile, First Minister Nicola Sturgeon hailed voters for rejecting a "far-right thug" at the ballot box as she held her Glasgow Southside seat with a comfortable majority.

Ms Sturgeon said she was "proud" convicted racist Jayda Fransen, former deputy leader of Britain First, managed just 46 votes.

She paid tribute to her opponent Anas Sarwar, the Scottish Labour leader, who secured 10,279 votes to her 19,735 after challenging the First Minister in the seat.

Ms Sturgeon was previously praised for standing up to Ms Fransen during an ugly confrontation outside a Glasgow polling station.

In a speech after winning Glasgow Southside, Ms Sturgeon said: "It is the privilege of my life to represent the most multicultural, diverse constituency in the whole of Scotland. And yesterday, not for the first time, the constituency was targeted by far right thugs.

"The far-right thug who led that confrontation got 46 votes and I am proud that once again Glasgow Southside has shown the racists and the fascists that they are not welcome in Glasgow Southside, they are not welcome in Glasgow and they are not welcome anywhere in Scotland, and let that be a note of unity."

During her speech at the count in Glasgow, Ms Sturgeon thanked her campaign team and Mr Sarwar, her main opponent.

She said: "Anas and I are opponents but I think we are in a strange position, perhaps, in politics – I think I can speak for him, although he might correct me if I'm wrong here – where we actually quite like each other, and that can make it difficult to campaign against someone."

Mr Sarwar increased the Labour vote but failed to eat into Ms Sturgeon's majority.