Alex Salmond, the former nationalist leader who took Scotland to the brink of independence in 2014, said Wednesday he has resigned from the Scottish National Party (SNP) amid sexual misconduct accusations.
The move comes after it emerged last week that two complaints were raised in January against the former first minister alleging sexual harassment while he was in office in 2013.
He has fiercely denied the claims and is taking court action against the Scottish Government to contest the complaints process activated against him.
But in a video message posted on social media Wednesday evening Salmond announced he would quit the SNP to prevent "substantial internal division" and attacks from rival political parties.
"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," he said.
"Most of all I am conscious that if the party felt forced into suspending me it would cause substantial internal division."
Salmond reiterated his denials of the harassment complaints, adding he rejected "any suggestion of criminality".
Police have been asked to investigate allegations he sexually assaulted two staff members at the first minister's official residence at Bute House in Edinburgh, according to reports last week in the Daily Record newspaper.
The matter was passed on to the police by Scottish government officials following an internal probe, it said.
Salmond claims the Scottish government acted "unlawfully" in raising the complaint over three years after he left office but it has said it will "defend its position vigorously".
Salmond added Wednesday: "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.
"They have been the defining commitment of my life."
He said he intended 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," he added.