Alex Salmond has admitted that he was "not entirely confident" the SNP Government would survive its first full term in office.
The Nationalists formed a minority administration after the party's 2007 Scottish election victory. Without an overall majority of MSPs, it suffered defeats in Holyrood votes, most notably with one of its budgets.
Mr Salmond said the fact that the SNP survived its first four years in power is more due to Bruce Crawford, the outgoing Parliamentary Business and Government Strategy Secretary, than any other person.
"This is perhaps an admission I am unwise to make. I was not entirely convinced, given the arithmetic of the parliament when the Government came to office in 2007, that we would manage to survive the full term. I hope I never portrayed any lack of confidence in the longevity of the Government when I was leading it."
The "odd narrow squeak, the odd budget vote, the odd close vote" meant he feared that the first-ever SNP Government "might end with a dunt".
Mr Salmond said: "The fact that it didn't end with a dunt, the fact that we managed to get through our legislative programme, the fact that a minority government succeeded in four years in office is more due to Bruce Crawford than any single individual."
He also thanked two other ministers leaving the Government: Stewart Stevenson, stepping down as Environment and Climate Change Minister, and Brian Adam, quitting as Parliamentary Business Minister.
Meanwhile, Holyrood formally approved the appointment of four ministers. Joe Fitzpatrick is taking on the post of Parliamentary Business Minister, with Mr Salmond revealing that Mr Fitzpatrick was in Japan on business when the appointment was announced.
Margaret Burgess, a former Citizens Advice Bureau manager who was elected to the Scottish Parliament last year, becomes Housing and Welfare Minister.
Paul Wheelhouse, also voted in for the first time last May, becomes Environment and Climate Change Minister. Humza Yousaf, one of the youngest MSPs and also newly elected, is the External Affairs and International Development Minister. Mr Yousaf is the first Muslim minister in the Parliament and Mr Salmond said this demonstrates that "this is a Parliament for all of Scotland".