NICOLA Sturgeon admitted that a botched investigation into allegations against Alex Salmond went “catastrophically wrong” after errors on the Government’s part.

The Scottish Government eventually conceded the judicial review brought by Mr Salmond after the probe was found to be unfair and “tainted by apparent bias”.

The First Minister admitted that the civil service had made “mistakes” in how the complaints against her predecessor were handled, but stressed that despite this, “the civil service in Scotland acts properly and impartially at all times”.

She added: “There have been mistakes made in this, and I think there is a lot of learning to be done.

“I would put it to people when it is seen in terms of what actually happened this is an example of the institutions of the country, the independent institutions of the country, doing their job.”

READ MORE: Nicola Sturgeon speaks out over personal pain of discovering Alex Salmond allegations

Ms Sturgeon said that it was “undeniable” that mistakes had happened.

The Scottish Government handed over some of the legal advice it had received over whether it was worth continuing to fight the judicial review, with Ms Sturgeon claiming that if the Government's legal team did not think there was any chance of the case being successful, "they would not have agreed to continue".

Conservative MSP Murdo Fraser stressed that the documents had shown that by December 6 “if not before”, the risk of losing the judicial review was “very high”.

READ MORE: Recap: Nicola Sturgeon gives crucial evidence to Salmond committee

He added: “You were risking public funds in continuing with the action.”

The First Minister told him: “I think every time a government defends a legal action it is risking public funds, because there is never a guarantee you are going to be successful.”

She added: “My understanding is that much of what went really wrong in the case, catastrophically wrong… was in that later stage of December, when it became clear, I believe not intentionally, that there was information and material that had not hitherto been disclosed.

“Up until as late as December 11 it was the opinion of law officers we had a stateable case with credible arguments.”