JOHN Swinney has admitted the Scottish Government had “reservations” about defending its costly legal fight with Alex Salmond months before it finally threw in the towel.

The deputy first minister confirmed the Government was aware of what would prove a fatal flaw in its case as early as October 2018, yet persisted until it collapsed entirely. 

The statement could back up Mr Salmond’s claim that the Government prolonged its doomed defence longer than was legally justifiable and abused public funds.

Mr Swinney today argued there were “good public policy grounds” for continuing the defence action, but did not say there were good legal grounds for doing so.

The Scottish Tories said it confirmed the Government had been "reckless" and wasted taxpayers' money.

The party also said it would keep pushing for a vote of no confidence in Mr Swinney unless he published all his legal advice on the matter, not just some of it.

Mr Swinney's admission comes in a letter to the Holyrood inquiry into the Salmond affair hours before the Government publishes its legal advice on the case.

READ MORE: John Swinney agrees to release Salmond documents after job threat

After months of refusals, Mr Swinney last night agreed to release “key” legal advice on the case after it was clear he would lose a no confidence vote in parliament.

In his letter, Mr Swinney portrayed the U-turn that will save his job as acting in the public interest.

He said publication of the advice was justified by the “exceptional circumstances” of public confidence being undermined in the the parliament, Government and justice system - a situation the opposition blames on the SNP's own secrecy and obstruction.

The inquiry is looking at how the Government bungled a probe into sexual misconduct allegations made against Mr Salmond in 2018.

The former First Minister had the exercise set aside in a a judicial review in January 2019, showing it had been “tainted by apparent bias” and getting £512,000 in legal costs.

The Government’s cardinal mistake was to appoint an investigating officer who had been in substantial prior contact with Mr Salmond's accusers instead of someone unconnected, as the Government's own policy stipulated.

It has since emerged that Government lawyers knew of the prior contact by late October 2018, but the Government did not concede until January 2019.

Mr Salmond claims the Government prolonged the defence unreasonably, wasting public money, and only gave up when their external counsel threatened to quit.

He also claims Nicola Sturgeon broke the ministerial code by persisting with the case in the face of legal warnings, squandering taxpayers’ cash in the process.

The inquiry has tried for months to get the Government’s legal advice to see if this is the case, but Mr Swinney refused, despite two votes in parliament for disclosure.

He cited the Government’s legal privilege and the long-standing convention that advice to ministers is secret.

However the Scottish ministerial code allows disclosure of legal advice in the public interest if the law officers consent to a request from ministers to release it.

The SNP Government has already released legal advice to three judge-led inquiries.

After the Tories tabled a no confidence vote at Holyrood, and the other opposition parties agreed to back it, putting his job in the line, Mr Swinney changed his position.

In a new letter to the inquiry this morning, he said the advice would be published this afternoon, but did not say whether it would be full or partial.

READ MORE: Neil Mackay - The Yes movement has been corrupted by hate and conspiracy. I no longer recognise what it has become

He wrote: "As the Committee [of inquiry] is aware, there is no existing precedent for the Scottish Government to waive legal privilege in the circumstances of litigation and I have been concerned about the potential risk of creating a new precedent that would impact on the ability of future administrations to receive candid and confidential legal advice.

“However, over recent days there has been public debate about the ability of the Parliament to hold the Government to account. 

“Accusations have also been raised with the Committee, without evidence, about the reasons why the Government continued to defend the judicial review until it was conceded on a single ground in January 2019.

“I am concerned that this debate and the accusations, if not responded to, could impact negatively on public confidence in the Parliament, Government and even our justice institutions. 

“I have determined therefore, consistent with the terms of section 2.40 of the Scottish Ministerial Code, that, in these exceptional circumstances, the balance of public interest now lies in releasing to the Committee and for publication the contents of legal advice received by the Government during the judicial review, in particular the contents of advice from external Counsel. 

“The Law Officers have provided their consent that there are compelling reasons for disclosure in these specific circumstances.

“The documents confirm that, whilst reservations were raised about the judicial review following the identification of the issue of prior contact with the complainers in late October, 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.

“Subject to completing the necessary legal notifications, in line with our statutory obligations, we aim to release the material to the Committee on Tuesday afternoon.”

The timing means the material will be made public after the Government's top law officers, the Lord Advocate James Wolffe QC, gives his evidence this morning. 

READ MORE: Salmond Inquiry - How to watch as Lord Advocate James Wolffe faces fresh questions

Scottish Tory leader Douglas Ross said: "The legal advice that John Swinney claimed would exonerate the government actually confirms what everyone suspected.

"The government knew of the fatal flaw in their case months before conceding but went on to waste £500,000 of taxpayers' money anyway.

"Recklessly continuing with the judicial review when it was doomed would clearly be a breach of the Ministerial Code. The public deserve to know exactly what mistakes were made.

"John Swinney is not getting away with releasing only the evidence he wants us to see. We will press ahead with the Vote of No Confidence until all the legal advice is published.

"I'd like to thank other opposition parties for supporting Scottish Conservative moves to have the legal advice released for a third time. The government must be held to account and by uniting behind our motion, we will ensure the will of the Scottish Parliament is respected."

Shortly after Mr Salmond won the judicial review, Mr Salmond was charged with sexual assault.

He was acquitted on all charges in a High Court trial last March.

He has since claimed there was a concerted and malicious effort by senior SNP personnel, including Ms Sturgeon's husbandd, party chief executive Peter Murrell, to ruin him and even have him jailed.

In oral evidence to the inquiry last week, he said being plotted to whip up police compliants so that the criminal investigation would overtake his civil action against the Government, and the latter would be frozen or 'sisted', thus sparing the Government embarassment.

In his letter, Mr Swinney said the Government was unable to find any relevant documents which supported Mr Salmond's allegation about ministers wanting to kill off the judicial review by having it sisted.

He said: "As set out in earlier evidence provided by the Scottish Government, the issue of whether the judicial review should be sisted in light of the criminal investigation was considered at the start of the judicial review process in September.

"Once the Scottish Government was content that necessary arrangements were in place to protect the identities of the complainers to minimise impact of the judicial review proceedings on the police investigation, there was no need to sist the case.

"The Scottish Government agreed to the reporting restrictions proposed by the petitioner [Mr Salmond].

"I hope that access to the legal advice, including the advice from external Counsel, will assist the Committee in fulfilling its remit and address some of the allegations that have been raised, without evidence, in the past few days."