The Scottish Government’s legal battle with Alex Salmond collapsed following a “watershed” meeting in December 2018, newly-released legal advice shows.

Documents setting out prior contact between those who complained of harassment and the investigating officer were revealed at a late stage in the legal challenge, contradicting earlier claims from the government.

This led to permanent secretary Leslie Evans notifying ministers on January 2, 2019, that the review should be conceded – a decision which was lodged with the Court of Session two days later – though concerns about prior contact between a complainer and the investigating officer were first raised in October 2018.

READ MORE: Salmond inquiry writes to Nicola Sturgeon's husband seeking 'clarification'

The decision meant Mr Salmond received a payout of more than £500,000, with the court ruling at a hearing on January 8, 2019, that the investigation had been “tainted by apparent bias”.

A redacted version of legal advice dated December 29, 2018, was published on Wednesday.

It follows a dispute between a Scottish Parliament committee investigating the handling of harassment complaints and the government over access to the document.

The document in question, which was sent to Ms Evans, said: “The key point to note is the ‘watershed moment’ of last Friday (December 21, 2018), at which point the SG’s case became [Redacted], unstateable, given what emerged that day about the nature of the contact between the IO (investigating officer) and the prospective complainers prior to their formal complaints having been made.”

It went on to say there was nothing to suggest officials were acting “in bad faith”, but it was clear the process of producing documents had not been “systematic and comprehensive”.

The legal advice stated that conceding the case before Lord Pentland in the Court of Session was likely to be the only “sensible” way forward, adding that their legal team would have to quit the case if the matter was not resolved.

In a covering statement to the document released on Wednesday, the Scottish Government acknowledged that there had been a “collective organisational failure” to gather all the relevant evidence.

It said: “Lessons have been learned from that about the identification and co-ordination of documents during such processes.”

READ MORE: Salmond inquiry reaches agreement with Government over access to undisclosed papers 

Commenting on the publication of the legal advice, Conservative committee member Murdo Fraser said: “The contents of these documents reveal senior SNP government officials were hellbent on defending an indefensible case.

“It seems to have taken threats from outside lawyers to quit before common sense finally prevailed.

“The government’s cavalier and reckless action not only failed the two female complainers, it also cost taxpayers a fortune in legal costs.

“These revelations make it more important than ever for the government legal advice to be released in full, as has twice been demanded by the Scottish Parliament.”