The Scottish Conservatives are calling on Nicola Sturgeon to resign after the Scottish Government published legal advice related to the botched investigation into allegations of sexual harassment by Alex Salmond.

Deputy First Minister John Swinney agreed to hand over legal advice under threat of a no-confidence vote, and acknowledged “reservations were raised” by government lawyers about the way allegations about Mr Salmond were investigated.

The Scottish Government launched an investigation into allegations of sexual harassment by the former first minister, but it was found to be unlawful, unfair and “tainted by apparent bias” because of prior contact between the investigating officer and two of the women who complained.

Redacted legal advice published by the Scottish Government on Tuesday evening showed that lawyers advised them in September 2018 that there “is a real risk that the court may be persuaded by the petitioner’s case in respect of the ground of challenge based on ‘procedural unfairness’.”

On December 6 2018 legal advisers told ministers that in their view the “least worst option” would be to concede the petition.

They wrote: “We understand how unpalatable that advice will be, and we do not tender it lightly.

“But we cannot let the respondents sail forth into January’s hearing without the now very real risks of doing so being crystal clear to all concerned.”

The Tories said they will submit a vote of no confidence in Ms Sturgeon.

Scottish Conservative leader Douglas Ross said: “Credible witnesses have now backed up Alex Salmond’s claims and the legal advice shows the Government knew months in advance that the judicial review was doomed, but they still went on to waste more than £500,000 of taxpayers’ money.

“There is no longer any doubt that Nicola Sturgeon lied to the Scottish Parliament and broke the ministerial code on numerous counts.”

He added: “The weight of the evidence is overwhelming. Nicola Sturgeon must resign.

“We will be submitting a vote of no confidence in the First Minister.”

A spokesperson for Nicola Sturgeon said: “The First Minister will address all of the issues raised – and much more besides – at the committee tomorrow, while the independent adviser on the ministerial code will report in due course.

“But to call a vote of no confidence in the middle of a pandemic, before hearing a single word of the First Minister’s evidence, is utterly irresponsible.

“It is for the public to decide who they want to govern Scotland and – while we continue to fight the Covid pandemic – with the election campaign starting in just 20 days, that is precisely what they will be able to do.”

Although the investigating officer (IO), Judith Mackinnon, said under oath that she had always been open about the contact with complainers, Scottish Government lawyers purportedly did not learn of it until October 2018, nine months after the investigation began.

It took the Scottish Government until January 8 for the Government to concede the case – a week before the full judicial review was due to start.

The former first minister, who was awarded maximum legal costs of £512,250 in part because of the late concession, has alleged that the Government had hoped a looming criminal trial would “ride to the rescue” and prevent its unlawful investigation suffering a “cataclysmic” civil court defeat.

The documents published on Tuesday showed that counsel for the Scottish Government learned about prior contact between the investigating officer (IO) and a complainer in late October which they said was concerning and first raised the prospect of conceding the case.

In a note to the Scottish Government on October 31 2018, Roddy Dunlop QC wrote: “I can well understand the angst that even suggesting (b) [conceding the petition] will provoke, but if the proceedings are vitiated then it makes little sense to continue to defend the indefensible.”

In a joint note to the Scottish Government on December 19 2018, Mr Dunlop and Solicitor Advocate Christine O’Neill stated: “We are now in a position where we think that maintaining a defence of the appointment of the IO may be unstatable.”

In November 2020, the Scottish Parliament twice passed motions demanding the Government publish all the legal advice it had received about Mr Salmond’s judicial review.

After a motion of no confidence was lodged, on Monday, in the deputy first minister, over the Government’s refusal to comply with the will of parliament, Mr Swinney agreed to hand over the “key” legal advice to the Holyrood inquiry into the botched investigation.

In a letter ahead of the release of the legal advice, Mr Swinney acknowledged lawyers had raised “reservations” about the issue of prior contact.

But he insisted there were “good public policy arguments and reasonable grounds for the Government to continue to defend the judicial review and to seek a determination from the court on the matters raised, until the events of late December 2018”.