The Scottish Lord Advocate today dismissed claims of interference in the Alex Salmond probe as 'wholly without foundation'.
Giving evidence to a Holyrood committee, James Wolffe QC said he had recused himself from key decisions over the probe into handling of allegations against the former First Minister.
And he flatly rejected that idea that the Crown Office had insisted on the redaction of parts of Mr Salmond's written evidence in a bid to hamper the process.
The session comes ahead of Ms Sturgeon's own long-awaited appearance before the cross-party committee tomorrow - and with pivotal legal advice set to be published later.
In six hours of brutal testimony last week, Mr Salmond laid out a case that senior SNP figures conspired to try to force him out of public life over harassment claims. He won a £500,000 settlement against the Scottish government, and was cleared of wrongdoing in a trial.
He also vented fury that the Crown Office, led by Mr Wolffe, had forced the redaction of sections of his written evidence to the committee.
Mr Wolffe said: 'Any suggestion, from any quarter, that the Crown's decision-making has at any time been influenced by irrelevant considerations or improper motivations would be wholly without foundation.
'Insinuation and assertions to the contrary are baseless.'
He said the crown had been criticised for 'actions it has taken to protect the identity of the complainers' at Alex Salmond's criminal trial, at which he was acquitted of all charges.
The legal advice received by the Scottish government over Mr Salmond's judicial review of its complaints procedure is due to be published later after ministers caved in.
Mr Wolffe suggested he had not been asked whether the advice could be released until yesterday, as ministers had not believed the 'public interest' favoured its disclosure until then.
Giving evidence to a Holyrood committee today, James Wolffe QC said he had recused himself from key decisions over the probe into handling of allegations against Alex Salmond
Mr Wolffe is facing a grilling on the eve of the long-awaited appearance by Nicola Sturgeon
In six hours of brutal testimony last week, Alex Salmond laid out a case that senior SNP figures conspired to try to force him out of public life over harassment claims
Nicola Sturgeon (left) has denied breaking the ministerial code and said she will give her full rebuttal tomorrow. The Conservative dossier (right) highlights dozens of instances when Ms Sturgeon appears to have broken the ministerial code
Scottish Tories accuse SNP of deliberately fixing Sturgeon's committee grilling for same day as the Budget
The Scottish Tories have accused the SNP of trying to protect Nicola Sturgeon by fixing her committee grilling for the same day as the Budget.
The First Minister is finally set to give her testimony at Holyrood tomorrow - with her career on the line.
But the showdown could be overshadowed with Rishi Sunak delivering his historic post-Covid Budget on the same day.
A Scottish Tory spokesman said: 'The timing of this appearance is certainly very convenient for Nicola Sturgeon.
'During Alex Salmond's evidence last week, the SNP MSPs on the committee embarrassed themselves by trying to run out the clock. It was a hopeless filibuster attempt that failed.
'Now they're clearly trying to give their boss a helping hand by limiting when and how long she appears before the committee.
'At every turn the SNP are trying to shut down scrutiny and cover up what really happened in this sorry affair.'
The Scottish Tories have accused Ms Sturgeon of breaching the ministerial code up to 38 times during the row.
A Conservative dossier highlights dozens of instances when they say Ms Sturgeon appears to have broken the ministerial code.
They include accusations of repeatedly misleading the Scottish Parliament about when she first knew of the allegations against Mr Salmond, delaying settling the judicial review despite legal advice, and meeting Mr Salmond on government business without any officials present or records being taken.
Ms Sturgeon has denied breaking the ministerial code and said she will give her full rebuttal tomorrow.
Scottish Tory leader Douglas Ross said: 'This dossier shows all the evidence of SNP cover ups, dreadful mistakes and terrible lapses of judgement.
'Sleaze and secrecy is running rampant throughout the ruling party of government.
'Nicola Sturgeon stands accused of breaking the Ministerial Code up to 38 times. The First Minister and her inner circle are facing 14 separate resignation matters.
'The weight of evidence is overwhelming – and this is only what we know about. So much more continues to be hidden by the SNP.
'The First Minister has abused the power of her office and government to cover up what really happened, what she knew and when she knew it.'
The burgeoning row is threatening to derail Ms Sturgeon's push to split up the UK, with support for independence diving over recent weeks.
Scotland's Deputy First Minister John Swinney is today finally set to release the legal advice the government was given over the judicial review, after a dramatic U-turn in the face of a no-confidence motion.
The advice relates to Mr Salmond's successful legal challenge of the Scottish Government's harassment complaints procedure, which led to him being awarded more than £500,000.
In a letter to the committee this morning, Mr Swinney said details of the legal advice would be released this afternoon - and they show 'reservations' about proceeding with the case.
'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,' he wrote.
The Scottish Tories submitted a motion of no confidence in Mr Swinney at Holyrood yesterday after accusing him of failing to comply with two parliamentary votes calling for the publication of legal advice.
Tory whip Miles Brigg MSP said he will not withdraw the Motion of No Confidence until MSPs are given assurances that SNP Ministers will deliver everything the committee has requested.
Mr Salmond insisted last week that, if the case was pursued by Ms Sturgeon against legal advice, it would be a breach of the ministerial code.
Mr Swinney said: 'In normal circumstances, government legal advice is not released. Indeed, such is the importance of being able to get frank, private advice, it is almost unheard of for the legal advice to be released.
'But, we have to acknowledge that the issues at stake now are not normal. The very integrity of the legal system is being questioned.
John Swinney said that subject to the mandatory legal checks and processes, the Scottish Government will release 'the key legal advice' today
The dossier's allegations about Ms Sturgeon include repeatedly misleading the Scottish Parliament about when she first knew of the allegations against Mr Salmond, delaying settling the judicial review despite legal advice, and meeting Mr Salmond on government business without any officials present or records being taken
'Serious allegations have been made. This material allows people to confirm that these allegations are false.
'We have already shared in private with the Scottish Parliament's committee on these issues the substance of the advice.
'Now, we recognise that in order to counter to the false claims being made by some, we must go further. Subject to the mandatory legal checks and processes, we will release the key legal advice.'
It would have been the second time in less than a year that Mr Swinney faced a debate on his position after he survived a no-confidence in August thanks to the Scottish Greens. This time they had signalled they would vote against him.
The Scottish parliament has twice voted to compel the release of the advice ministers and officials obtained during the judicial review brought about by the former SNP leader.
However, they have previously refused to do so, citing legal privilege. In January 2019, the Government was forced to admit it had acted unlawfully and its investigation had been 'tainted by apparent bias' after Mr Salmond successfully challenged its investigation into complaints against him.
The outcome of the probe was set aside when it emerged that the investigating officer had prior contact with two women who made allegations against Mr Salmond.
Lord Advocate James Wolffe will be questioned about both issues by the cross-party MSPs this morning
It was previously revealed that the issue had been identified months before the Government conceded.
But the inquiry is keen to know when ministers and officials were advised to drop their defence - and admit defeat.
Mr Swinney's decision has received the prior agreement of the Law Officers in line with paragraph 2.40 of the Scottish Ministerial Code.
Ahead of release, under the General Data Protection Regulation, legal notifications to individuals impacted are required.
The Scottish Government said that these are expected to be complete and, subject to them, the Parliament will receive the material immediately thereafter.
The Lord Advocate is due face questions about the Crown Office's controversial intervention in redacting Mr Salmond's evidence and the apparent breach of a court order about releasing evidence.
Mr Wolffe has been recalled to give more evidence to the committee into the Scottish Government's unlawful investigation of harassment complaints about the former first minister.
Mr Salmond last week said that Mr Wolffe, who is both the head of the Crown Office, the body for prosecuting crime in Scotland, and a member of the Scottish Government, should resign over the saga, which ended up costing Scottish taxpayers more than £600,000.