Former Scottish first minister Alex Salmond has resigned his membership of the SNP amid allegations of sexual harassment.
Mr Salmond made the revelation in a video message posted on social media on Wednesday evening.
Two complaints were raised in January against the ex-SNP leader, who fiercely denies the allegations, and he was informed of an investigation in March.
Mr Salmond is taking court action against the Scottish Government to contest the complaints process activated against him, with papers lodged at the Court of Session in Edinburgh on Tuesday.
In the message posted on Twitter, Mr Salmond said he has written to the party’s national secretary to resign his membership.
He stated: “I have been a member of the Scottish National Party for 45 years, 20 of them as party leader and seven as first minister of Scotland.
“I hope I have done the party and the broader cause of independence some service.
“Apart from a political spat back in the 1980s, that has been a period of continuous membership.
“I truly love the SNP and the wider independence movement in Scotland. They have been the defining commitment of my life.
“But today I have written to the national secretary of the party resigning my membership.”
Mr Salmond indicated that his resignation was to avoid potential divisions within the party.
He stated: “It seems obvious that (Scottish First Minister) Nicola (Sturgeon) feels under pressure from other political parties to suspend me from SNP membership, given recent party precedents…
“I did not come into politics to facilitate opposition attacks on the SNP and, with Parliament returning next week, I have tendered my resignation to remove this line of opposition attack.
“Most of all, I am conscious that if the party felt forced into suspending me it would cause substantial internal division.”
He added that it is his “absolute intention to reapply for SNP membership “just as soon as I have had the opportunity to clear my name”.
“In the meantime, I would urge no one else to relinquish their SNP membership,” he added.
The allegations about Mr Salmond’s conduct towards two staff members in 2013, while he was in office, emerged last week.
The Daily Record newspaper published what it claimed were details of one of the complaints over the weekend.
Police Scotland confirmed on Friday that the complaints have been passed to the force.
The Scottish Government this week confirmed there are no recorded complaints about Mr Salmond from before January this year.
He reiterated his strong denial of the allegations in the video message, saying: “Let me be clear again. I refute these two complaints of harassment and I absolutely reject any suggestion of criminality.”
Earlier this week, he wrote to Scotland’s top civil servant, calling for an inquiry into how the allegations against him were made public.
“I believe that all such issues must be treated seriously, confidentially and through a fair process. In this case confidentiality has been broken greatly to my detriment and in a way which puts at serious risk the anonymity of both complainants,” Mr Salmond said in the message.
“It urgently needs to be established who breached that duty of confidence and why.”
He said his “entire focus” is now on preparing for the judicial review proceedings at Scotland’s highest civil court and he has launched a crowd-funding campaign to help with costs.
“My intention is to secure fairness because that is necessary to clear my name,” he said.
A spokesman for the Scottish Conservatives said: “This is an overdue move, but one that plunges Scotland’s governing party into turmoil.
“The fact he now has the brass neck to publicly crowdfund in the same breath as seemingly doing the right thing is astonishing.
“Scotland now faces the incredible and unprecedented situation of its most famous former First Minister appealing to SNP supporters for cash to take legal action against the government he used to run.”
NICOLA STURGEON REVEALS 'HUGE SADNESS' OVER SALMOND SITUATION
Nicola Sturgeon has spoken of her sadness after Alex Salmond, her mentor for three decades, resigned from the SNP.
The First Minister and SNP leader spoke of an "incredibly difficult" few days for the party and said she understands why Mr Salmond has chosen to resign his membership.
She also reiterated her stance that the two complaints received by the Scottish Government could not be ignored.
In a statement, Ms Sturgeon said: "I feel a huge sadness about this whole situation. Alex has been my friend and mentor for almost 30 years and his contribution to the SNP and the independence movement speaks for itself.
"While the decision to resign has been Alex's alone, I understand why he has chosen to separate the current questions he is facing from the day to day business of the SNP and the ongoing campaign for independence."
She continued: "These last few days have been incredibly difficult for the party and, I am sure, for those involved in the complaints that have been made to the Scottish Government. I appreciate that they will have been difficult for Alex too.
"However, the hard fact remains that two complaints were received by the Scottish Government that could not be ignored or swept under the carpet. Complaints must be investigated without fear or favour, regardless of the seniority of the person involved.
"I know party members will be upset by this news, just as I am. I also know there are many questions that can only be answered in the fullness of time. It is important now that any legal processes are allowed to take their course."
Meanwhile, opposition parties have attacked Mr Salmond's crowd-funding campaign.
A spokesman for the Scottish Conservatives said: "The fact he now has the brass neck to publicly crowdfund in the same breath as seemingly doing the right thing is astonishing.
"Scotland now faces the incredible and unprecedented situation of its most famous former First Minister appealing to SNP supporters for cash to take legal action against the government he used to run."
Scottish Labours Rhoda Grant MSP, said it was "unbelievable" that he would pursue such a move.
She said: "It suggests that he is sending a signal to those who have made allegations that he has the upper hand.
"Decent people will rightly be furious that he is to raise money to take the Scottish Government to court. Alex Salmond is abusing his power, and dragging Scotland into the gutter."
Copyright (c) Press Association Ltd. 2018, All Rights Reserved. Picture (c) Jane Barlow / PA Wire.