Nicola Sturgeon was given a standing ovation as she made her last speech at Holyrood as First Minister, saying holding the post for the last eight years "truly has been the privilege of my lifetime".
In a statement made at the end of First Minister's Questions, Ms Sturgeon thanked Scots for "placing your trust in me".
Three years to the day from the start of the first coronavirus lockdown, she told how she had "led Scotland through good times but also through the toughest period of our recent history".
The experience of the pandemic "changed me", she said, telling MSPs that her thoughts "today and always are with those who lost loved ones to Covid" as well as others still suffering as a result of the virus.
Speaking about the experience of the pandemic, she said: "In the toughest of times, our country showed the best of itself with love, care and solidarity.
"That will live with me forever."
Ms Sturgeon - Scotland's first female first minister and also the longest serving incumbent in the post - described the job as "challenging, exhilarating and exhausting".
But after 35 years in politics, including 24 as an MSP and 16 in the Scottish Government, she said it is the "right time" for her to step aside. Her successor will be appointed next week.
Ms Sturgeon told MSPs: "I have made my fair share of mistakes in the last eight years. And, of course, there are things I wish I had done better or differently.
"But overall and overwhelmingly, I am proud of what has been achieved."
She listed the introduction of the Scottish Child Payment, a benefit which goes to low-income families with children in Scotland, and the minimum unit pricing for alcohol as some of her achievements in Government.
But she also said that just by becoming first minister, "no girl in our country now has any doubt that a woman can hold the highest office in the land".
Her successor will either be the second female first minister or the first person from an ethnic minority background to hold the top job, with Scottish Finance Secretary Kate Forbes, former Scottish Government minister Ash Regan and Scottish Health Secretary Humza Yousaf vying for the post.
Ms Sturgeon said that whoever takes her place, "it will send the powerful message that this, the highest office in the land, is one that any young person in Scotland can aspire to".
She told her three would-be successors: "Never forget that every day in this office is an opportunity to make something better for someone, somewhere in Scotland.
"Do not shy away from the big challenges or difficult debates.
"You won't get everything right. But it is always better to aim high and fall short than not try at all."
Ms Sturgeon arrived in the chamber with her long-serving Deputy First Minister John Swinney - who is also stepping down next week.
She ended her final contribution in the Parliament chamber as First Minister by thanking the people of Scotland "whether you voted for me or not".
She said: "Thank you so much for placing your trust in me.
"Words will never convey the gratitude and awe I hold in my heart for the opportunity I have had to serve as your First Minister.
"It truly has been the privilege of my lifetime."
Want a quick and expert briefing on the biggest news stories? Listen to our latest podcasts to find out What You Need To Know.