Mr Salmond made the revelation in a video message posted on social media this evening (Wednesday).
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.