Describing the party she joined at the age of 16 as her “extended family”, she said she hoped it would stay united after she leaves and keep serving Scotland “as a team”.
She also made a wider call for kindness in politics, urging those in the SNP and those representing other parties to treat each other as “opponents not enemies”.
In an emotional parting statement to MSPs, Ms Sturgeon said holding the post of First Minister for the last eight years “truly has been the privilege of my lifetime”.
When she succeeded Alex Salmond in November 2014, she became the first woman in the role, and has since become the longest serving First Minister in Scotland’s history.
Describing the job as “challenging, exhilarating and exhausting”, she said she had made her “fair share of mistakes” but that ultimately she was proud of her achievements.
Her surprise resignation announcement last month triggered the first SNP leadership contest for almost 20 years, with her successor due to be announced on Monday.
The campaign has proved to be bruising for the party, with several of the candidates strongly criticising its own record in Government as they set out how they would do things differently.
Party president, Michael Russell, also accused some within the party of setting out to “damage our cause and aid our enemies” by questioning the integrity of the leadership election.
In a plea for unity on Thursday, Ms Sturgeon told her party: “We’ve come such a long way together as a team – let us keep going, serving Scotland together as a team.”
Speaking afterwards, she said she was confident that the SNP would endure, dismissing what she described as “hyperbolic phrases” about its impending “collapse”.
“I have real confidence in whoever my successor is to continue to build on the success of the party and the Government,” she said. “But to do that, they must remain focused on the interests and the priorities of people across the country.”
Ms Sturgeon ended her final contribution in the Holyrood 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.”