Nicola Sturgeon’s husband Peter Murrell has resigned as the SNP’s chief executive with immediate effect.
Reports had suggested members of the SNP’s ruling National Executive Committee (NEC) threatened a vote of no confidence in him.
It follows the departure of the SNP media chief Murray Foote, who left on Friday amid a row over the party’s membership numbers.
Earlier, SNP leadership candidate Kate Forbes had acknowledged “extraordinary turmoil” in the party.
Mr Murrell has been the party’s chief executive for more than 20 years.
In a statement on Saturday, Mr Murrell said: “Responsibility for the SNP’s responses to media queries about our membership number lies with me as chief executive.
“While there was no intent to mislead, I accept that this has been the outcome. I have therefore decided to confirm my intention to step down as chief executive with immediate effect.
“I had not planned to confirm this decision until after the leadership election.
“However, as my future has become a distraction from the campaign I have concluded that I should stand down now, so the party can focus fully on issues about Scotland’s future.
“The election contest is being run by the national secretary and I have had no role in it at any point.
“I am very proud of what has been achieved in my time as chief executive and of the part I have played in securing the electoral success the party has enjoyed over almost two decades.
“Fourteen national election wins is testament to the skills of the dedicated and talented HQ team that I have been privileged to lead.
“They give their all to the party and the independence cause and I thank them for it.
“I have worked for independence all my life and will continue to do so, albeit in a different capacity, until it is achieved – and I do firmly believe that independence is now closer than ever.”
Earlier this week, it emerged that the party had lost 30,000 members in just over a year.
Mr Foote said that after speaking to the party’s HQ, he had issued responses to the media which had “serious issues” and he later decided there was a “serious impediment” to his role.
On Thursday, the party revealed membership as of February 15 this year was 72,186, having fallen from 103,884 in 2021.
This corroborated a story in the Sunday Mail in February around the SNP losing 30,000 members, something Mr Foote had strongly denied at the time.
The Herald newspaper reported a senior member of the NEC said: “We have the numbers. There’s not a hope in hell that Peter can survive a no confidence motion.”
On Saturday, Ms Forbes issued an open letter to SNP members who had yet to cast their vote.
She said: “Many of you, like me, will be hurt and bemused by the extraordinary turmoil in our party over the last days.
“If anyone was in any doubt that this needs to be a change election for the SNP, recent events and resignations confirm the core message of my campaign: continuity won’t cut it.”
She continued: “I love the SNP, and I am passionate about Scotland’s future as an independent, fair and wealthy nation.
“A few years ago, scandal rocked the SNP and I was asked to step up and deliver the budget with only a few hours’ notice.
“I did it, for my party and for the people of this country. That is the mark of who I am. I will not shy away from difficult times.
“Instead I find the solution and give it my all.
“I have a great deal of respect for the two other candidates, but I am the only candidate who can truly deliver change as First Minister.”
Ms Forbes, who is on maternity leave from her government role as Finance Secretary, pledged to reform the party and committed to independent auditing of membership and finances.