Alex Salmond has dramatically quit the Scottish National party as he seeks to clear his name of sexual misconduct charges.

The former SNP leader and first minister, who brought the party to power at Holyrood in 2007 and close to winning an independence referendum in 2014, said he wanted to focus on his judicial review against the Scottish government over its handling of the two complaints.

In a lengthy statement posted on Twitter, Salmond said: “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.”

His lawyers filed his judicial review application with the court of session, Scotland’s civil court, earlier this week. He is also facing a police investigation into those allegations.

Salmond’s statement said he would reapply to the party if he wins his case and at the same time launched a crowd-funding appeal to help pay his legal costs. Less than two hours after launching the appeal on Twitter, he had raised £27,000 against an initial target of £50,000.

Salmond said his high stakes move was designed to avoid his legal battles damaging and splitting the SNP, but it will be seen as a tactical move to win greater sympathy from party activists. It also risks splitting the party between Salmond loyalists and those who back his successor as leader and first minister, Nicola Sturgeon, only a few weeks before she hosts its annual conference in Glasgow.

Corbyn and Salmond’s deep-state fears are a very British fantasy | Martin Kettle Read more

In a statement on Twitter, Sturgeon said: “I feel a huge sadness about this whole situation. Alex has been my friend and mentor for almost 30 years. [These] last few days have been incredibly difficult for the party and, I am sure, for those involved in the complaints.”

She added that regardless of the distress to her and her party “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.”

The Scottish Conservatives said Salmond’s strategy raised an “incredible and unprecedented situation” where its most significant figure wanted money from SNP supporters to fight a government he once led and which was still run by their party.

Rhoda Grant, the Scottish Labour MSP who sits on several cross-party groups representing women’s interests, said the former first minster was “dragging Scotland into the gutter.” She added: “That an independently wealthy man with his celebrity and political power is to raise legal fees through a crowdfunder for a case ultimately linked to sexual harassment is unbelievable.

“It suggests that he is sending a signal to those who have made allegations that he has the upper hand.”

Holyrood must focus on the Alex Salmond harassment claims, not point-scoring | Dani Garavelli Read more

Sturgeon has come under intense pressure from opposition parties to suspend Salmond’s membership while the Police Scotland investigation into the claims is under way.

Play Video 0:33 'Extremely upsetting': Nicola Sturgeon reacts to Alex Salmond legal battle – video

Salmond said in his statement he did not enter politics to damage the SNP but implied too the party was facing a split over his case. Many Salmond loyalists in the party are furious that Sturgeon’s government has confirmed that he is under investigation.

“Most of all I am conscious that if the party is forced into suspending me it would cause substantial internal division,” he said. He also implied that he disagreed with Sturgeon’s previous decision to suspend her former children’s minister Mark McDonald from the SNP over sexual harassment allegations against him.

He points out that the Scottish government had said no internal complaint had been made against him until January this year, adding: “Let me be clear again. I refute these two complaints of harassment and I absolutely reject any suggestion of criminality.”

Since the allegations against Salmond came to light last Thursday night, he has suggested that proving that the Scottish government mishandled the complaints will absolve him. However, the police investigation is legally separate and could see him face criminal charges.

Senior SNP figures were unwilling to immediately discuss the announcement publicly but offered differing private views.

Some suggested it was driven by ego rather than to save the party from disrepute. Others said it was helpful he had separated himself from the party while the police investigation was ongoing. They pointed out that it also meant the SNP could not take any disciplinary action against him at a later date.

They said it removes pressure on Sturgeon to suspend him, effectively sidelining him during the SNP’s upcoming conference. But one senior supporter warns that the resignation frees Salmond to “go to war”, in particular over the timing of a second independence referendum, as he fights to preserve his legacy.

Salmond is a relatively wealthy man. After nearly 30 years in the Westminster and Scottish parliaments and more than seven years as first minister he has parliamentary pensions and continuing earnings from his media work. He is married but without children.

He is currently the host of his own chatshow on the Kremlin-funded RT television network, is an author and the host of a live chatshow that tours theatres and arts venues.

He said, however, he needed help with his legal costs. That is likely to be the focus of a major appeal by his supporters and allies, who will use it to increase the profile of his campaign.

In his statement, Salmond said: “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 crowdfunder 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.”