"I have always regarded Sir Gus O'Donnell as a model civil servant, who has been extremely fair in recognising and respecting the democratic mandate of the Scottish government," first minister Alex Salmond said.

"Sir Gus is right to recognise the importance of the constitutional issue, and the SNP government are up for the challenge of building and winning the case for Scottish independence - unlike the Westminster parties, who seem to have their heads buried in the sand."

The outgoing Cabinet secretary, known as 'GoD' by his civil service colleagues, also cited the way the EU operates as another huge challenge facing the country.

He used the article to call on the civil service to become a "central part" of the economy's recovery and growth.

"We must be more creative and innovative in the way we solve problems without always resorting to the creation of new rules," Sir Gus urged.

"We must also be prepared to take more risks. In a media environment where failure is punished much harder than success is celebrated, this is more difficult for ministers and civil servants than for our friends and colleagues in the private sector.

"There are some promising signs that we can, in fact, do this quite well, but taking risks means having a grown-up approach to failure. We should celebrate success and learn from failure."

He concluded: "The more we can innovate, the more we can find alternatives to legislation and regulation, and the more we can overcome our aversion to risk, the more we can help drive the economy and really ensure the civil service is an engine room for growth. I would be proud of that legacy."