Nicola Sturgeon has referred herself to an independent ministerial ethics body after bowing to intense pressure to allow an investigation into her actions in the Alex Salmond sexual harassment case.

The first minister’s move follows her admission that she held a secret meeting with Salmond at her home, in the presence of her government-employed chief of staff and one of Salmond’s advisers, where he briefed her on a Scottish government inquiry into sexual harassment allegations against him.

Opposition parties said that meeting and a subsequent phone call with Salmond were in clear breach of the ministerial code since discussions with outsiders on government business had to be immediately reported to civil servants. Richard Leonard, the Scottish Labour leader, said it was a “grave error of judgment”.

Sturgeon revealed on Thursday it took two months before she raised the meeting and phone call with Leslie Evans, the Scottish government’s top civil servant, and only did so because she was about to meet Salmond for a second time.

Sturgeon advised Evans in writing that legal action by Salmond against the Scottish government was imminent, but denies that was an intervention in the inquiry.

Her spokesman has also refused to confirm or deny that Salmond urged her to intervene at that meeting. The two had a total of three face-to-face meetings and two phone calls where the investigation was discussed over a 15-week period last summer.

Sturgeon insists her meeting with Salmond was a party matter but she acknowledged on Sunday that her claims that she acted in line with the ministerial code needed to be confirmed by independent advisers.

“I have acted appropriately and in good faith throughout, and in compliance with the ministerial code at all times. However, I have reflected carefully and understand that it is also important for parliament and the wider public to be assured of that,” she said.

Her conduct will now be investigated by a two-person panel made up of Dame Elish Angiolini, a former lord advocate, Scotland’s chief prosecutor, and James Hamilton, a former director of public prosecutions in the Republic of Ireland.

Sturgeon said the panel’s remit would be carefully drawn up to avoid it compromising a police criminal investigation into the allegations against Salmond. Sturgeon said the interests of the women in the case must be paramount. Salmond denies the allegations of sexual harassment against him.

Sturgeon said: “The fact remains that at the centre of this issue are two women whose complaints could not be swept under the carpet.

“Any continuing commentary about these issues at this stage – whether from myself, the government or Mr Salmond and his representatives – would only serve to distract from and potentially compromise the proper consideration by the police of the subject matter of their investigations. That is something we will not do.”

Sturgeon had come under pressure to make the referral, which under the Scottish government’s rules can only be made by a first minister, from senior figures in the Scottish National party.

Richard Leonard, the Scottish Labour leader, said Sturgeon had done the right thing by heeding opposition calls for her to refer herself. But there still needed to be a separate Scottish parliament investigation into the entire episode, with Holyrood also given powers to review the ministerial code inquiry.

“Transparency is now absolutely essential in order for the public to have confidence in the first minister and the Scottish government,” he said. “That is why we should also see a full, public parliamentary inquiry in to what exactly has happened – and I look forward to working constructively with members from other parties this week in order to secure that.”

On Sunday, Kevin Pringle, Salmond’s former spin doctor and a former communications chief for the SNP, urged her to do so quickly. “The first minister will have to be bold and candid” to allow her to rebuild the party’s reputation, he said.

Pringle was Salmond’s chief spokesman when the then first minister made several self-referrals under the ministerial code. Salmond was exonerated of any breach each time.

Writing in the Sunday Times, Pringle said the “drip-drip of information coming out slowly is poison” for Sturgeon’s government and the SNP. He said it undermined the case for independence if the civil service that would run an independent Scotland could not be trusted.

“Last week was torrid for Sturgeon, and it can’t go on like that,” Pringle said. “She should lead the charge for an independent, external inquiry into the whole business, covering the conduct of ministers and officials. It may be uncomfortable, but it’s the only path to better ground.”

It also emerged that Salmond’s claims the Scottish government leaked confidential data about the sexual harassment allegations against him are being investigated by a watchdog’s criminal offences unit.

The Herald on Sunday reported that the Information Commissioner’s Office (ICO), which polices the UK’s data protection legislation, passed Salmond’s complaints to its criminal investigations desk in November last year.

Two women filed formal complaints of sexual harassment against Salmond in January last year under the Scottish government’s new ministerial complaints system.

In late August, Evans confirmed the cases had been investigated and reports had been handed to the police after news of the inquiry leaked. The leak triggered Salmond’s complaints to the ICO alongside a judicial review of the government’s handling of the investigation.

The Herald on Sunday reports the ICO wrote to Salmond last year to say that based on the information he provided, an offence in breach of section 170 of the Data Protection Act “may have been committed”. That section prohibits the unlawful obtaining or disclosure of personal data.

The government’s case dramatically collapsed last week after Evans admitted that the civil servant who investigated the complaints had already been counselling both women, a conflict of interest in breach of the complaints process.

Evans’s future is now in doubt, with some senior SNP figures predicting she will be forced out. Sturgeon’s decision to refer herself under the ministerial code will take some of the pressure off Evans.