Who is Peter Murrell? The former SNP chief who transformed his party
Peter Murrell was a constant in the hierarchy of the Scottish National Party for more than two decades.
He became chief executive as the sun was setting on the last century and as the dawn was rising on the new chapter of devolution.
During the 59-year-old's tenure the party grew in confidence and became an indomitable election winning machine.
But in the public's eye he would be remembered for something else - being married to Scotland's first minister.
It was on a summer's day in 2010 when Nicola Sturgeon married her long-term partner Peter at a ceremony in Glasgow.
He had already been SNP chief for 11 years and she was deputy first minister in charge of the health brief for the Scottish government, led by Alex Salmond.
Power couple
Politics played its part in bringing these two together. According to a biography of Ms Sturgeon by David Torrance, they first met in 1988 at an SNP youth weekend and became a couple in 2003.
They never had children but Ms Sturgeon later revealed the painful experience of suffering a miscarriage when she was 40, shortly before the 2011 Scottish parliamentary election campaign.
"Sometimes... having a baby just doesn't happen - no matter how much we might want it to," she said.
The powerful couple would be seen together at party conferences, outside polling stations and at official events such as the Queen's Jubilee concert. But while relaxed in each other's company, they were not gushy hand-holders who lingered before a gathered media.
On occasions when asked about her husband - notably during her appearance on ITV's Loose Women - Ms Sturgeon was quick to credit Mr Murrell for his cooking skills.
She has also given insight into how he has supported her political leadership. Ms Sturgeon told the Sunday Times: "One of the things I value is that he's happy with me having the public role... He's not one of those guys who would feel threatened by it. He doesn't have that sort of ego, he's very self-assured."
Mr Murrell has similarly spoken of his respect for his wife's intellect, saying: "She's very, very sharp and on top of whatever the issue of the day is. That spark is always there. We are constantly having conversations that I'm amazed by."
In the spotlight
It clearly suited the FM's husband to be in the background but he, and his role as chief executive, came under scrutiny during the inquiry into the Scottish government's handling of complaints against former first minister Alex Salmond.
At the Holyrood Inquiry in 2020, Mr Murrell denied plotting against Mr Salmond. But opposition MSPs believed that Mr Murrell contradicted himself, and Ms Sturgeon, over some of the details he gave in evidence.
He was pressed repeatedly about whether the meetings between Ms Sturgeon and Mr Salmond were SNP business, as the first minister had insisted, or government business - which would need to be officially recorded.
Mr Murrell was back in the media spotlight in December 2022 when it was confirmed he had given a loan of £107,620 to the SNP to help it out with "cash flow" issues.
The SNP had repaid about half of the money by October of that year and the party's official line was that the loan was a "personal contribution made by the chief executive to assist with cash flow after the Holyrood election".
These questions were difficult ones for Ms Sturgeon and she had to awkwardly bat away media probes about what she knew of her husband's financial situation - "that is for him," she said at an FM's update at the beginning of last year.
Despite this discomfort, she continued to lead the country and he continued to be in charge of the party machine.
But then Ms Sturgeon announced her decision to resign. Some commentators said it would be inevitable that Mr Murrell would also have to go but his departure has happened before his wife's.
Pressure mounted on him when two of the three candidates vying to be new party leader and first minister publicly questioned the contest they were taking part in.
Row over member numbers
From the outset, contender Ash Regan said Mr Murrell's position as SNP chief executive was a "clear conflict of interest".
And this theme would not go away with another candidate, Kate Forbes, questioning the integrity of the electoral process.
What led the chief executive to go was linked to a row about party membership and who would be voting in this election.
One point of pride for Mr Murrell had been his campaign to increase followers after the failed Scottish independence referendum of 2014 and the coronation of his wife as leader and first minister.
The SNP went from a membership of less than 25,000 in 2013 to more than 125,000 by December 2019.
But that figure had fallen back to 72,000 by March 2023 and the party only reluctantly confirmed this when media and opposition pressure, plus questions from all three candidates, became too much.
The power couple who helped shaped Scottish politics in the first two decades of this century are no more.