Nicola Sturgeon has defended her response to revelations that Scotland's chief medical officer had twice breached coronavirus lockdown rules.
The first minister initially backed Dr Catherine Calderwood to keep her job.
But it was announced later on Sunday night that she had resigned after a further "long conversation" with Ms Sturgeon.
Ms Sturgeon told her daily coronavirus briefing that the "balance of judgement changed" as the day went on.
She said she was "deeply sorry that this situation has arisen", but that the coronavirus crisis meant she had "things to balance" that would not normally have been considerations.
Ms Sturgeon added: "I have set out pretty fully my own thought processes and decision making, and I stand by that.
"But I didn't want this situation to arise, I regret it and I am deeply sorry for it".
She also said Dr Calderwood failed to reveal a second visit to her holiday home during the coronavirus lockdown when the news broke on Saturday evening, and had only disclosed it the following day.
Dr Calderwood was given a police warning on Sunday after the Scottish Sun published photographs taken the previous day of her and her family visiting their second home in Earlsferry in Fife - more than an hour's drive from her main family home in Edinburgh.
The chief medical officer had regularly appeared in TV and radio adverts urging the public to stay at home to save lives and protect the NHS, and took part in daily televised media briefings alongside Ms Sturgeon.
The Scottish government initially said that the chief medical officer had been working seven days a week, and had taken the opportunity to check on her second home because she would not have had another chance to do so until the crisis was over.
However, Dr Calderwood admitted during Sunday's coronavirus briefing that she had also visited the Fife property with her husband the previous weekend.
Despite mounting anger over Dr Calderwood's actions, which were clear breaches of the instruction to avoid unnecessary travel, Ms Sturgeon repeatedly told the briefing that she wanted the chief medical officer to remain in her role.
She said Dr Calderwood's advice and expertise were "invaluable" during the coronavirus crisis, and were vital to her ability to lead the country through the pandemic.
The first minister told BBC Breakfast on Monday morning that she later had a "long conversation" with Dr Calderwood, by which time there was "mutual agreement" about the need for her to step down.
Ms Sturgeon added: "By last night it became clear that the bigger risk was the damage it could be doing to the very important message that the government is putting forward right now. So these are not easy judgements."
The first minister said that Dr Calderwood had "made a mistake, she made a serious mistake and people are right to be angry about it".
The timeline of Dr Calderwood's resignation
- 14:30 - At her Covid-19 media conference on Sunday, Ms Sturgeon said that Dr Calderwood would continue to provide Scottish government "with the scientific and medical advice on the spread of Coronavirus".
- Dr Calderwood told that same briefing that there were "no excuses" for the action she had taken to visit her second home in Fife. She said: "What I did was wrong, I'm very sorry and it will not happen again."
- 16:39 - Ms Sturgeon issued a statement saying that Dr Calderwood would be "withdrawing from media briefings for the foreseeable future" and that the government would be revising its public information campaign.
- 21:54 - Dr Calderwood resigns from her post saying: "I am deeply sorry for my actions and the mistakes I have made."
Why Dr Catherine Calderwood had to go
What on earth was she thinking? This was either grossly naive, achingly foolish or staggeringly arrogant. And either way the chief medical officer had to go.
Dr Calderwood was not a bystander in this crisis. Not a disinterested observer, however prominent. Not a remote analyst.
She was the public face of a campaign to persuade the public to stay at home. She delivered this message, repeatedly, in sonorous and sententious tones. And then she neglected those guidelines in her personal life.
This is comparable to an individual who is leading an initiative to persuade the public of the merits of vegetarianism, who then indulges in a T-bone with a side order of bacon.
In fact, it is worse. It was Dr Calderwood herself who echoed the mantra of the Scottish and UK authorities that by staying at home we would helping to protect the NHS - and thus to save lives.