Peter Murrell, the Scottish National Party's chief executive and Nicola Sturgeon's husband resigned with immediate effect.
Reports had suggested that Murrell had been threatened with a vote of no confidence and told to resign by the end of Saturday.
It comes after the departure of SNP media chief Murray Foote, who left on Friday amid a row over the party's membership numbers.
In a statement, Murrell said: Responsibility for the SNP's responses to media queries about our membership number lies with me as chief executive. I accept that this has been the outcome, even though there was no intent to mislead. I have decided to step down as Chief Executive with immediate effect.
I had not planned to confirm this decision until after the leadership election. As my future has become a distraction from the campaign I have concluded that I should stand down now so that the party can focus fully on issues about Scotland's future.
The national secretary is running the election and I haven't had any role in it at any point.