Nicola Sturgeon choked back tears as she said there was a "large part of me" who wished she was not first minister during the Covid pandemic.
She became emotional as she gave evidence on Wednesday to the Covid Inquiry, saying: "I was the first minister when the pandemic struck.
"There's a large part of me wishes that I hadn't been but I was and I wanted to be the best first minister."
Ms Sturgeon added that it was "for others to judge" if she succeeded in her aim.
She said that her "only motivation" during the pandemic was to do the "best we could" to keep people as safe as possible.
She again became emotional as she denied suggestions that the Scottish Government used the pandemic for political purposes.
UK minister Michael Gove previously accused the Scottish Government of seeking “political conflict” during the pandemic.
Ms Sturgeon, fighting back tears, said: “The idea that in those horrendous days, weeks, I was thinking of political opportunity” was “not the case”.
Ms Sturgeon added: “At times in those early days, I felt overwhelmed by the scale of what we were dealing with and perhaps more than anything, I felt an overwhelming responsibility to do the best I could.”
As she began giving evidence at the hearing in Edinburgh, the former first minister of Scotland was shown her statement to the inquiry, where she said there was a "high degree of formality around Scottish Government decision making".
Her statement continued: "During the pandemic I did not make extensive use of informal messaging and certainly did not use it to make decisions."
She maintained the Scottish Government was "open, transparent and accountable" throughout its pandemic response.
Jamie Dawson KC, senior counsel to the inquiry, put it to Ms Sturgeon that she "at least rarely used (informal messaging)".
She replied: "I have not said, and I'm not saying today, that I never used informal means of communication. What I am saying is that I did so very rarely and not to discuss issues of substance or anything that could be described as decision-making."
While WhatsApp had become "too common" a means of communication within the Scottish Government, Ms Sturgeon said she exchanged WhatsApps with no more than a "handful" of people, and was not a member of any groups, with now First Minister Humza Yousaf, and her former chief of staff, Liz Lloyd, the main people she communicated with in this way.
She said she deleted these informal messages, in line with official advice, and "salient" points were all recorded on the corporate record.
She said: "I operated from 2007, based on advice, the policy that messages, business relating to government, should not be kept on a phone that could be lost or stolen and insecure in that way, but properly recorded through the system."
The inquiry was shown messages between Ms Sturgeon and Ms Lloyd showing the former SNP leader saying she is "having a crisis of decision-making" over hospitality and adding "it's all so random" when discussing restrictions on restaurants.
Ms Sturgeon wrote: "I am having a bit of a crisis in decision-making in hospitality, not helped by the fact I haven't slept. The public health argument says stick with 6pm/no alcohol for level 3. But I suspect the industry will go mad - and I worry we could derail debate."
Ms Sturgeon told the inquiry she did not think there was anything in the exchange which would not be recorded in Cabinet minutes or in the public record.
She added: "This is why I don't think WhatsApp should be used to have substantial discussions - four years on we can put on a different interpretation.
"But there were moments that whatever we would do, would cause difficulty and harm for somebody."
Ms Sturgeon said did not recall receiving an email from senior civil servants about the importance of record retention of material relevant to the work of the inquiry.
Mr Dawson asked: "You recall, I would imagine, in a general sense, that such a notification was sent out?"
Ms Sturgeon said: "I would say this, that I don't think I would have required to see that to know that matters that were relevant to know the matters that were relevant."
The former first minister said she had "always assumed there would be a public inquiry" and apologised for any lack of clarity at a public briefing where she said her WhatsApps would be handed over despite knowing they had been deleted.
She was also questioned on her decision to provide public health expert Professor Devi Sridhar with her SNP email address, which she said she "perhaps shouldn't have".
Ms Sturgeon added: "But if I had been in any way trying to direct her to a private email address, I doubt if I would have put my Government email address in there as well."
Several figures in Ms Sturgeon's Government have already faced questions at the inquiry about their deletion of WhatsApp messages during the pandemic.