Within minutes of Nicola Sturgeon announcing her resignation 40 days ago, a shell-shocked SNP started thinking about the future, with just about every Holyrood backbencher with a pulse being tipped as a potential replacement. 

A great number of the early favourites moved quickly to rule themselves out. John Swinney was one of the first to say no, thank you. 

He said he had instead decided to "create the space for a fresh perspective to emerge".

Angus Robertson soon followed, saying his priority was being “first dad” rather than first minister. 

Other potential candidates, including relative newbies Mairi McAllan, Neil Gray, Ben MacPherson and relative old-timer Keith Brown all soon followed suit.

Full unlimited access to The Herald is only £2 for 2 months.

👉 Click here to get this offer 👈

It wasn’t until four days after the First Minister announced her exit plan, that Ash Regan and Humza Yousaf both announced their bids. 

READ MORE: Humza Yousaf and Ash Regan announce SNP leadership bids

“You’ve got to put yourself forward if you think you’re the best person for the job,” the Health Secretary said. “And I do. This is the top job in the country, and it needs somebody who has experience.”

Ms Regan - who quit as community safety minister over the Gender Recognition Reform Bill - said the Scottish Government needed to “draw a line under certain things and move past them”.

Kate Forbes announced her candidacy the next day, literally seconds before Mr Yousaf launched his campaign in front of some hastily printed placards in Clydebank.

The Herald:

“We need to choose strong, competent leadership to deliver independence - the leadership that I can offer.

"I believe we need someone who can unite our party and our movement,” she said. “I'm a unifier.”

One phrase I don’t think anyone was expecting to hear during the leadership contest was “out-of-wedlock,” but, well, we did.

Before Kate Forbes - a member of the socially conservative, evangelical Free Church of Scotland - had confirmed her candidacy, there was frenzied speculation about what priorities she might have as first minister.

The birth of baby Naomi in August meant she’d been on maternity leave when parliament had voted on the Gender Recognition Reform Bill. But she had been critical of the legislation in the past. 

She had also spoken at a prayer breakfast where she had expressed an anti-abortion sentiment. 

In her first round of interviews, there was no spin, no deflection, just the God’s honest truth. 

She stunned a number of her supporters when she said she would have voted against equal marriage laws had she been an MSP in 2014.

The Herald:

In a later interview, the MSP for Skye, Lochaber and Badenoch said she celebrates babies born to unmarried couples, but it was not in line with the teachings of her church. 

"For me, it would be wrong according to my faith, but for you I have no idea what your faith is. So, in a free society you can do what you want."

Scottish Government ministers Richard Lochhead, Tom Arthur and Clare Haughey who all backed Ms Forbes withdrew their support. So too did health committee convener Gillian Martin and MP Drew Hendry.

READ MORE: Kate Forbes: I would have voted against equal marriage

SNP deputy Westminster leader Mhairi Black said she had been “incredibly hurt” by the comments, with Deputy First Minister John Swinney saying he “profoundly” disagreed with them.

Ms Forbes apologised for any hurt caused, saying she was “greatly burdened and heartsore that some of my responses to direct questions in the media have caused hurt to friends, colleagues and fellow citizens.”

Equal marriage wasn’t just a problem for Kate Forbes, there were questions too for Humza Yousaf. Though he backed the legislation at its first parliamentary stage in November 2013, he missed the final Stage 3 vote in February 2014.

He said this was because he had an “unavoidable” meeting with the Pakistan Consul General in Glasgow to discuss the case of Mohammad Asghar, a Scot with a history of mental illness, who was on death row in Pakistan for blasphemy.

However, Alex Neil, who led the same-sex marriage legislation through Holyrood, claimed that Mr Yousaf missed the final vote because of “pressure from the mosque”.

Alex Salmond then intervened to say that that was his recollection too. 

READ MORE: Alex Salmond queries Humza Yousaf's gay marriage vote excuse

He said Mr Yousaf, then minister for external affairs, had deliberately arranged a ministerial meeting as “cover” for his absence.

Mr Yousaf flatly denied the claims. 

They can’t both be right. Someone must either be misremembering or lying. Is it the former first minister or a possible future first minister?

Last Tuesday’s final debate was the sixteenth time the candidates had faced each other in little more than 25 days. It’s lucky the last two gatherings were for the radio rather than the telly, the three of them (understandably) looked knackered. 

The Herald:

The first hustings in Cumbernauld was maybe an early indicator that SNP HQ wasn’t completely on top of the contest.

The sessions were to be held behind closed doors, with only the members lucky enough to secure a ticket allowed to know what happened. 

Party bosses said they had decided to keep the public out of the contest to find a new first minister as members needed "a safe space” to ask questions.

READ MORE: SNP HQ bars press from leadership contest hustings

That sparked a furious response from press, activists, opposition parties and the candidates themselves. 

The decision was soon revoked, with all subsequent SNP-organised hustings being live-streamed.

Highlights for the watching public included Ash Regan’s call for a “readiness thermometer” to be built in Glasgow or Edinburgh as a visual representation of just how prepared Scotland is for independence.

She was ridiculed for it, but unlike the other two candidates she was calling for a fairly radical change in how the party wins Scottish independence. 

The Herald:

Away from the party-organised hustings - which were mostly quite amiable - were the TV debates which were unexpectedly explosive. 

The gloves didn’t just come off during the first STV ding dong, they were thrown in Humza Yousaf’s face as Kate Forbes savaged his record, suggesting he - and Nicola Sturgeon’s government - was a “mediocrity” who would let down the Yes movement and the country.

She then went for the jugular in the cross-examination section of the STV hustings, asking Mr Yousaf why he would succeed as first minister when he had failed in all his other jobs.

“Humza, you've had a number of jobs in government. 

"You were a transport minister and the trains were never on time, when you were justice secretary the police were stretched to breaking point, and now as health minister, we've got record high waiting times. 

“What makes you think you can do a better job as first minister?”

READ MORE: Forbes savages Yousaf's record in first TV hustings of SNP leadership

The remark left Mr Yousaf - and many of his Holyrood colleagues - absolutely stunned. It also reportedly left Nicola Sturgeon furious. Douglas Ross was near floating when he recounted it for her at that week’s First Minister’s Questions.

It was repeated back at Stephen Flynn by Rishi Sunak, and will probably end up on every opposition party leaflet if Mr Yousaf wins. 

One of the recurring themes of the contest has been its integrity. Can the process and the result be trusted?

It’s obvious that most of the party hierarchy wants Humza Yousaf to win. He’s been backed by most of the SNP’s MPs and MSPs. At the last count (according to the increasingly invaluable Ballot Box Scotland) He’d won over 35 MSPs and 21 MPs, compared to Kate Forbes’s 11 Holyrood supporters and five Westminster backers.

Ash Regan has only won over Joanna Cherry. 

There was controversy too when it emerged that Nicola Sturgeon’s most senior aide is working on the Yousaf campaign. 

According to the Scottish Sun, Special Adviser Liz Lloyd was “putting Nicola’s wishes into practice.”

That’s led to open speculation that SNP HQ was trying to sway the vote for Mr Yousaf. 

Ash Regan suggested there is “a conflict of interest” in having SNP Chief executive Peter Murrell - husband of Ms Sturgeon - oversee the process.

“Effectively he’s running the contest to replace his wife,” she said. “That would be like Carrie [Johnson] counting the votes for Boris’s successor, and I think many people would think that would be fairly unusual. I think there is a conflict of interest here."

The Regan campaign even claimed supporters of the health secretary were being bussed into the hustings by party bosses, and that they were worried a lack of due diligence could lead to "ghost voters" - dead people and ex members - having a say in the contest.

Both claims were furiously rejected by the party.

Former health minister, Alex Neil took to Twitter to say the party needed to "stop any chance of the election being rigged."

"Keep an eye out for past members, lapsed members having their votes cast for them.

READ MORE: Regan campaign claims SNP HQ bussing Yousaf supporters to hustings 

In an open letter, Kate Forbes and Ash Regan called for more transparency in the contest. 

Key to this was the detail on exactly how many people had a vote in the contest. 

Ms Regan said knowing how many people were eligible to take part in the ballot was “crucial to fostering trust and confidence among the candidates, their campaign teams, and party members.

The former community safety minister said she and Ms Forbes had previously reached out to the National Secretary, Lorna Finn, with a request for this information. 

The lack of response meant they felt the need to “address this matter through a formal open letter.”

Following the publication of the open letter, Neil Gray, the campaign manager for Mr Yousaf said the Health Secretary’s campaign team had “also asked for the figures to be published and sought assurances this would be done as soon as possible."

However, the party initially rebuffed the request saying they wouldn’t reveal any figures until after the contest. 

That position did not hold.

Eventually, the party’s ruling NEC revealed that the total number of members eligible to vote was 72,186, a significant drop on the last publicly available figure which showed that at the end of 2021 the party had 103,884 signed-up members. 

At their peak in 2019, they had 125,691 members. 

The story then became about more than just plummeting support. In February, the Sunday Mail claimed the party’s membership had slumped by 30,000 since 2021. At the time, the story was described as “drivel” by SNP head of press Murray Foote.

After the real number was released and it was evident that the story was not drivel, Mr Foote - a former editor of the Daily Record - quit his post. However, he said that he hadn’t intended to mislead and that the duff figures had been fed to him by party HQ. 

That led to pressure on Peter Murrell, with the SNP’s ruling NEC even threatening a vote of no confidence if he didn’t resign. 

READ MORE: SNP NEC 'has the numbers' for vote of no confidence in Peter Murrell

He quit the post he’d held for the last 25 years later that day.

Mr Murrell insisted there had been "no intent to mislead" but accepted "that this has been the outcome".

SNP president Michael Russell, who is now acting chief executive, admitted that the party was in a “tremendous mess” and things had gone “spectacularly wrong”.

Outgoing leader Ms Sturgeon has defended the situation, saying the SNP is going through “some growing pains.”

The Herald:

A quick mention for the campaign gaffes. Ash Regan put her foot in it during Channel 4’s debate when she said she would give Gary Lineker a “red card” following the BBC row over his refugee tweet.

He was temporarily removed as presenter of the BBC’s Match Of The Day show after criticising the UK Government’s asylum seeker policy.

Ms Regan, who admitted she had not even seen his tweet, later backed him during a Channel 4 debate, saying “he should be allowed to express his views”.

READ MORE: 'Ignorant' Yousaf asks Ukrainian refugees: Where are all the men?

The biggest cringe of the contest came when Mr Yousaf asked “where are all the men?” when meeting Ukrainian refugees in Edinburgh. 

The men are, of course, in Ukraine defending their country against the Russian invasion.

So what now for the SNP? Can the party come together after this bruising campaign? What's clear is that the twists and turns of the race to replace Nicola Sturgeon look set to dominte the party's fate for some time to come.