Nicola Sturgeon has insisted "I would never have wanted to 'get' Alex Salmond", as she told a Holyrood committee she had "no motive, intention, (or) desire" for such action against her predecessor.
The Scottish First Minister rejected the "absurd suggestion that anyone acted with malice or as part of a plot against Alex Salmond", saying the "claim is not based in any fact".
She added: "There is nothing here that the government has to hide."
Ms Sturgeon told MSPs on the Committee on the Scottish Government Handling of Harassment Complaints that the details of complaints against Mr Salmond were "shocking" and his behaviour "was not always appropriate".
She said Mr Salmond's account to her of his "deeply inappropriate behaviour" is a "moment in my life that I will never forget", as she maintained she did not intervene in the Scottish government's investigation into her predecessor.
Ms Sturgeon apologised to the public and the women who submitted sexual harassment complaints about her predecessor as First Minister, saying there had been "a very serious mistake" in the Scottish government's investigation.
The inquiry into Mr Salmond was launched after a number of women came forward with allegations of sexual harassment.
But a successful judicial review by Mr Salmond resulted in the government investigation being ruled unlawful and "tainted by apparent bias", with a £512,250 payout awarded to him for legal fees.
Ms Sturgeon told MSPs on Wednesday it was "absolutely right" that the Scottish government investigated the complaints.
She said: "An individual's profile, status or connections should not result in complaints of this nature being ignored or swept under the carpet. That in this case it was a former first minister does not change that."
She said "two women were failed and taxpayers' money was lost, I deeply regret that".
She added: "Although I was not aware of the error at the time, I am the head of the Scottish government so I want to take this opportunity to say sorry to the two women involved and to the wider public."
Describing the long process leading to the inquiry, Ms Sturgeon said what happened was "simple".
She added: "A number of women made complaints against Alex Salmond. The government, despite the mistake it undoubtedly made, tried to do the right thing.
"As First Minister I refused to follow the age-old pattern of allowing a powerful man to use his status and connections to get what he wants."
Addressing Mr Salmond's evidence to the committee on Friday, Ms Sturgeon said: "That he was acquitted by a jury of criminal conduct is beyond question. But I know, just from what he told me, that his behaviour was not always appropriate.
"And yet across six hours of testimony, there was not a single word of regret, reflection or a simple acknowledgment of that. I can only hope in private the reality might be different."
The First Minister had originally claimed she first became aware of the Scottish government investigation into Mr Salmond on 2 April 2018, before later admitting to a 29 March meeting with Mr Salmond's former chief of staff.
She said that at the 29 March meeting, Mr Salmond's former chief of staff "did indicate a harassment-type issue had arisen, but my recollection is he did so in general terms".
She told the committee she wishes her memory of the meeting on 29 March was "more vivid", but "it was the detail of the complaints under the procedure that I was given on 2 April that was significant and indeed shocking".
Describing the 2 April meeting in her home with Mr Salmond, she said while he denied the complaints against him he gave his account of the incident which "he said he had apologised for at the time".
Ms Sturgeon told MSPs: "What he described constituted in my view deeply inappropriate behaviour on his part, perhaps a reason why that moment is embedded so strongly in my mind."
She said she did not "immediately record the 2 April meeting" as she did not want it to become public and risk "breaching the confidentiality of the process".
She added she had no intention of intervening in the investigation process and did not intervene, saying to do so would have been an abuse of her role.
Addressing the judicial review, Ms Sturgeon said there was strong prospects of defending the challenge, but that changed over a two-month period from October to December 2018.
As late as 11 December, the advice given was it was "very clear there was no need to drop the case", she said.
She added: "In one of the most invidious political and personal situations I have ever faced, I believed I acted properly and appropriately and that overall I made the best judgments I could."
Ms Sturgeon said there was "no intention" by the Scottish government to withhold information from the committee.
She added: "While the government made mistakes... there is nothing here that the government has to hide."
She said her government's complaints procedure is "lawful" but there was an error in the appointment of the investigating officer, who had prior contact with the two women who complained.
Ms Sturgeon is facing calls from the Scottish Conservatives to resign after two witnesses backed up Mr Salmond's claim that she misled Parliament about a meeting with her predecessor in evidence to the committee.