During a statement at the Scottish Parliament, Mr Salmond said it had been “the privilege of his life” to serve in the role for the past seven-and-a-half years.
He is making way for his deputy Nicola Sturgeon to take over, and he said she will make an “outstanding” First Minister.
Mr Salmond received a standing ovation from MSPs after delivering his final words, before being embraced by Ms Sturgeon.
He told his parliamentary colleagues he was leaving at a time when the Scottish electorate has become energised, empowered and engaged in politics once again following the independence referendum.
He said: “Any parting is tinged with some sorrow, but in this case it is vastly outweighed by a sense of optimism and confidence. Confidence that we will have an outstanding new First Minister. Confidence in the standing and the capability of this chamber, and most of all confidence in the wisdom, talent and potential of the people of Scotland.
“Scotland has changed, changed utterly and much for the better over the 15 years of this Parliament and over the seven years of this Government. But I am happy to say that with every degree of certainty that more change and better days lie ahead for this Parliament and for Scotland.”
He added: “Scotland now has the most energised, empowered and informed electorate of any country in Europe. We have a new generation of citizens who understand that their opinion matters, who believe that their voice will be heard and who know that their vote can shape the society they live in.
“For all of us that should be a point of pride, a source of challenge. For me, the sense of generational change has been a factor in deciding the time is right to move on from being First Minister.
“For this Parliament, it should spur us on to become even more accessible, to serve the new expectations of the people.”