Nicola Sturgeon has vowed to lead Scotland into the crucial May elections after being cleared of breaching the ministerial code over her dealings with Alex Salmond. James Hamilton, a former Irish prosecutor, has rejected a series of allegations that the first minister deliberately misled Holyrood about when she knew about sexual harassment allegations against her predecessor being investigated by Scottish government civil servants. Sturgeon said she was “obviously relieved” Hamilton had cleared her, and said she now wanted to focus on winning the May elections. “I’ll be putting myself forward as the candidate for first minister because there’s a big job of work to be done to continue to lead this country through a pandemic,” she said. “I believe I’m the right person to do that and I want to focus on these issues. I’ve just come off a call this afternoon with families who have been bereaved as a result of Covid, that’s where my focus and attention needs to lie.” Although Sturgeon is braced for publication of a highly critical report by MSPs into the controversy on Tuesday morning, Hamilton’s decision to clear her of wrongdoing now means she no longer faces losing a no confidence vote in Holyrood later on Tuesday. In a detailed report published on Monday, Hamilton said he accepted Sturgeon’s evidence she had never sought to mislead the Scottish parliament and had tried to avoid any appearance of interfering in the government’s internal inquiry. Hamilton said there were good reasons for being critical of the government’s botched inquiry, and he said Sturgeon had a “regrettable” memory lapse about her meeting with Salmond’s former chief of staff, Geoff Aberdein, in late March 2018. Sturgeon failed to tell Holyrood she had met Aberdein before seeing Salmond four days later, leading to repeated opposition allegations Sturgeon had deliberately concealed that information because she knew she had misled MSPs. Hamilton said Sturgeon had given “an incomplete narrative of events” but that was a “genuine failure of recollection and was not deliberate.” He concluded: “I find it difficult to think of any convincing reason why if she had in fact recalled the meeting she would have deliberately concealed it while disclosing all the conversations she had had with Mr Salmond.” Hamilton also said the government’s rules for ministerial special advisers needed to be strengthened and brought into line with the ministerial code, after expressing scepticism about an “elaborate” account by one of Sturgeon’s senior aides about her meeting with Aberdein before the first minister met Salmond. Sturgeon confirmed the government had begun an inquiry into the alleged leaking of a complainer’s name to Aberdein at that meeting. He told four close associates soon after meeting the aide they had given him a name; the senior aide denies leaking it. Hamilton said he found Aberdein’s recollection of the meeting was “more straightforward” than the “rather complicated” account of the government official he met. But, in a major blow to the Scottish Conservatives’ bid to win cross-party support for a vote of no confidence in Sturgeon on Tuesday, Hamilton said he did not believe any of her alleged breaches of the ministerial code were substantiated. With six weeks to go before a pivotal Holyrood election, his ruling is a significant boost for Sturgeon and the Scottish National party. Their support and backing for Scottish independence has been dented by the bitter feud between Sturgeon and Salmond over the sexual harassment controversy. If Hamilton had upheld accusations from Salmond and the Tories she had knowingly breached the Scottish government’s ministerial code, Sturgeon would have been under intense pressure to resign. However, Sturgeon is also braced for the findings of a Holyrood committee investigation into the controversy being published on Tuesday morning. It is expected to be fiercely critical of her government’s handling of the harassment allegations against Salmond. One of the committee’s findings, that Sturgeon did breach the ministerial code by giving a misleading account of her first meeting with Salmond, was leaked last week. But the committee has ruled she did not do so deliberately, weakening calls for her to resign. Sturgeon called on opposition parties to respect Hamilton’s “comprehensive, evidence-based and unequivocal” ruling, and drop demands that she quit. “Some pretty grim allegations have been levelled at me over the past months. They’ve not necessarily been easy,” she said. “They’ve been difficult to contend with but I have been at peace with my own conscience in all of these matters. I have been quite clear in my own mind that I acted appropriately.” Douglas Ross, the Scottish Tory leader, said his party did not agree with Hamilton’s assessment Sturgeon had an understandable memory lapse. “She is not free and clear. The first minister promised to ‘respect the decisions’ of both inquiry reports, not to pick and choose which one suits her and try to discredit the other,” Ross said. “As James Hamilton says, it is up to the Scottish parliament to decide if the first minister has been misleading.” Sturgeon called in Hamilton – the Scottish government’s independent adviser on the ministerial code and a former director of public prosecutions – to investigate her actions after Salmond won a legal challenge against her government’s inquiry into sexual harassment complaints against him in January 2019. Hamilton said that while he did not agree with Sturgeon’s original claim her meeting with Salmond at her home on 2 April 2018 was a party matter, he accepted her decision to meet her former mentor was “partly political and partly personal”. Since this was about an internal complaint about a former minister within the Scottish government, it was not external. Therefore, Salmond could raise a complaint with her without it needing to be officially recorded under the code. Hamilton also agreed with Sturgeon her initial decision not to disclose her meeting to senior civil servants, was the correct course of action. Sturgeon eventually told Leslie Evans, the permanent secretary of the Scottish government, more than two months after first meeting him. “I fully accept the logic of the first minister’s position that it would have been impossible to record such meetings or discussions without a risk of prejudicing the proceedings or interfering with their confidentiality,” Hamilton said. He also rejected Salmond’s assertion that Sturgeon was guilty of breaching the code because she had continued fighting against his judicial review despite legal advice. Salmond was later awarded £510,000 in legal costs after the judge in his judicial review case ruled the government had failed to properly disclose significant evidence quickly enough. “Mr Salmond appears to be under the misapprehension that the government is under a duty to withdraw a case if advised that there is less than an evens chance of winning. There is no such rule,” Hamilton said. Anas Sarwar, the Scottish Labour leader, distanced his party from the Tories and indicated Labour would not back the Tory no confidence motion. “Unlike others, we have been clear from the outset that we would not prejudge the outcome of this inquiry,” he said. “What is clear is that this entire process has deeply damaged public trust in our politics at a time of national crisis, and there are absolutely no winners today. At the heart of this are two women who have been badly let down by the government, and it remains the case that nobody has taken responsibility.”