The Scottish politician, 63, made the announcement in a statement which he tweeted last night.
The statement read: “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.
“But today I have written to the National Secretary of the Party resigning my membership.”
Why did Alex Salmond resign from the SNP last night?
Mr Salmond resigned following allegations of sexual harassment made by two female members of staff in 2013.
The complaints, which Mr Salmond denies, were made while he was still leader of the SNP.
He is accused of touching the breast and bottom of one woman through her clothing, only stopping after he was asked to multiple times.
Scottish government officials were told of the allegations in January before Mr Salmond was informed in March by Police Scotland.
Nicola Sturgeon, has called Mr Salmond’s resignation a “very sad moment”.
The First Minister has come under pressure to reveal when she first knew of the complaints.
On Sunday, she issued a statement saying “no complaints have been received” by the SNP in relation to the former leader’s conduct
What has Mr Salmond said about the allegations made?
In his latest statement, Mr Salmond firmly denied the accusations made against him, saying he had read Ms Sturgeon’s statement on Sunday in which she “made it clear that the SNP never received a single complaint about his personal conduct”
He added: “Let me be clear again. I refute these two complaints of harassment and I absolutely reject any suggestion of criminality.”
He is taking the Scottish Government to court to contest the complaints process brought against him, launching a crowdfunding campaign to raise the funds.
The move has been lambasted by the Scottish Government as “astonishing”.
Who is Alex Salmond?
Alex Salmond is the SNP’s most successful leader, serving as First Minister of Scotland from seven years from 2007 to 2014.
He was the party leader for twenty years, first joining 45 years ago when he was MSP for Gordon and Aberdeenshire East.
Mr Salmond campaigned heavily for a Scottish referendum on independence, before standing down as leader in July 2000.