FORMER SNP leader and First Minister Alex Salmond has resigned from the party of which he has been a member for 45 years.

Salmond said his resignation was to avoid a potential internal split in the SNP ranks. 

READ: Alex Salmond's full statement on why he resigned from the SNP

He told The National he was putting the cause of independence before himself as an individual, and that he would seek to rejoin as soon as he had cleared his name.

He also launched a Crowdfunder to raise money to cover the cost of legal fees he expects to rack up in that effort.

Salmond is taking the Scottish Government to court over its handling of an investigation into sexual harassment complaints made against him, which he has entirely denied.

WATCH: Alex Salmond's video message on why he left the SNP – for now

Two claims were received by the Government regarding Salmond, and he has called on Permanent Secretary Leslie Evans to investigate the source of leaks to the media about the anonymous allegations.

Salmond said in a video post on his Twitter feed: “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.

"I read carefully Nicola Sturgeon’s statement on Sunday and watched her television interview of a couple of days ago. She made it clear that the SNP have never received a single complaint about my personal conduct in my many decades of membership.

READ MORE: This is why there’s no story which can kill off independence

"And the Scottish Government have confirmed that they did not have any such complaint before this January, more than three years after I left office as First Minister. That is the record of 30 years of public service. So let me be clear again. I refute these two complaints of harassment and I absolutely reject any suggestion of criminality.

The National:

"It seems obvious that Nicola feels under pressure from other political parties to suspend me from SNP membership, given recent party precedents. For my part I have always thought it a very poor idea to suspend any party member on the basis of complaints and allegations. Innocent until proven guilty is central to our concept of justice.

"However, 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: "I am enormously grateful for the messages of support and encouragement I have received,including from people of other political persuasions. I can assure them all that I will keep on going.

"The costs of a Judicial Review in the highest court in the land are huge. Many have asked how they can help directly. Therefore I have established a crowd funder to assist with costs. All sums received will contribute exclusively to progressing the Judicial Review and any money left over will be used to support good causes in Scotland and beyond.

"Finally, I will continue to serve the independence movement in whatever role and whatever capacity I can. It is a rare thing to be devoted to a cause more important than any individual, it is a precious thing to cherish it and my intention now - as it has always been - is to protect and sustain that cause.”

Responding to the move, First Minister and SNP leader Sturgeon said: "I feel a huge sadness about this whole situation. Alex has been my friend and mentor for almost thirty 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.

"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.

"In the meantime, I agree with Alex that the cause of independence, to which both he and I have dedicated our entire lives, is bigger than any one individual. And the work we must do to achieve independence is more important now than ever."