FORMER SNP leader Alex Salmond has resigned from the party, in order to avoid a split.

It comes amid an internal investigation by the Scottish Government into sexual harassment allegations made against Salmond which he has entirely denied.

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

He is taking the Scottish Government to court over its handling of the investigation.

You can read our full story with background details by clicking here. Below is the transcript of his video message regarding his resignation.

---------------------------------------------

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.

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

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

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. It urgently needs to be established who breached that duty of confidence and why.

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.

READ: Nicola Sturgeon's full response to Alex Salmond resigning from SNP

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.

In my letter to the National Secretary I state that it is my absolute intention to reapply for SNP membership just as soon as I have had the opportunity to clear my name. I hope that is by the end of this year. In the meantime I would urge no one else to relinquish their SNP membership.

My entire focus for the next few weeks is preparing for Judicial Review, against the Permanent Secretary to the Scottish Government, the initial stages of which began yesterday. My intention is to secure fairness because that is necessary to clear my name.

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.