Edinburgh: Alex Salmond has begun a legal battle against Scotland’s top civil servant after she told him she was going public with two complaints of sexual misconduct against him.

In an unprecedented row, Salmond has been accused of sexual harassment by two female officials following incidents that allegedly took place while he was first minister of Scotland and have since been passed to the police.

Salmond vigorously denied the charges in a statement issued on Thursday night and accused Leslie Evans, Scotland’s most senior civil servant, of mishandling the investigation.

He said he denied all the allegations, “some of which were patently ridiculous”. Salmond added: “The procedure as put into operation by the permanent secretary is grossly unfair and therefore inevitably will lead to prejudicial outcomes.”

Salmond told BBC Scotland he was “no saint” and has “got flaws”, but added: “I have made many mistakes in my life, political and personal. But I have not sexually harassed anyone and I certainly have not been engaged in criminality.”

The former Scottish National Party leader has launched a legal challenge over the Scottish government’s handling of the allegations after being told by Evans on Wednesday they were going to be made public.

As the dispute escalated rapidly on Friday morning, Nicola Sturgeon, Salmond’s successor as first minister and SNP leader, admitted the explosive allegations against her former mentor caused her great discomfort and would deeply disturb Scottish National Party activists.

A visibly distressed Sturgeon told the BBC: “This is an incredibly difficult situation for me to come to terms with. Everybody knows the length and closeness of my relationship to Alex Salmond and I think people will understand how difficult this is for me and my party.

“This will be extremely upsetting to members of the SNP up and down the country. It is a difficult situation but what is important is that complaints are treated seriously regardless of who the person complained about is. I have been very clear about my belief in the importance of that, and that is a principle that cannot be applied selectively no matter how difficult that might be for me, my part or for others.”

In a long personal statement, she bluntly rejected Salmond’s allegations that the case had been mishandled and in a clear warning to his supporters in the SNP, said “complaints were made that could not be ignored or swept under the carpet”.

“I have been clear on many occasions that all organisations and workplaces must make it possible for people to come forward to report concerns and have confidence that they will be treated seriously,” she said.

“For that principle to mean anything it cannot be applied selectively. It must be applied without fear or favour, regardless of the identity, seniority or political allegiance of the person involved.”

Salmond was told of the allegations in March and he admitted on Thursday night that he had spent months trying to resolve the complaints privately, using mediation, conciliation and legal arbitration.

Those overtures were rejected by Evans, who issued her own formal statement on the affair. She said she told Salmond on Wednesday of her intention to make the fact of the complaints and her investigation public.

After he threatened Evans with an interdict to block publication, the Scottish government decided to delay its plans to release a statement. News of the investigations leaked to the Daily Record, which then put them to Salmond late on Thursday. On Friday Labour said that Salmond should be suspended from the SNP with immediate effect.

On Friday, Salmond dropped the interdict and instead is launching new legal proceedings in the civil courts seeking a judicial review of the department’s handling of the affair.

Salmond said: “If I lose then I will have to answer to the complaints both comprehensively and publicly. Until then I am bound to say nothing which would impinge on the court proceedings.

“[If] the court of session finds in my favour, then the administration at the senior levels of the Scottish government will have the most serious questions to answer.”

In her statement, Evans vigorously defended her department’s handling of the affair, which were investigated using much tougher procedures introduced by Evans and Sturgeon after serious complaints of sexual misconduct emerged at Westminster.

Evans stressed Sturgeon had nothing to do with the process at any stage. “I note that the former first minister has indicated his intention to challenge the actions taken by the Scottish government.

“His statement contains significant inaccuracies which will be addressed in those court proceedings. The Scottish government will defend its position vigorously. You will appreciate that for legal reasons the Scottish government is limited in what can be said.

“The first minister has had no role in this process. I advised her of the conclusions of my investigation on Wednesday and she is of course aware that I am making this statement today. As the head of the civil service in Scotland, I have been consistently clear that there is no place for harassment of any kind in the workplace,” Evans said.

Sturgeon confirmed she had been aware for some time about the allegations. Evans told her earlier this week she planned to go public. Sturgeon supported Evans’s defence of the Scottish government’s handling of the affair.

“Alex Salmond is now challenging the Scottish government’s procedure in court. The Scottish government refutes his criticisms of its process and will defend its position vigorously. [The] overriding priority must be to ensure fair and due process. I would also ask that the privacy of those who have complained be respected.”