JOHN Swinney is to leave the Scottish Government alongside Nicola Sturgeon, he has announced.

The Deputy First Minister said he would stand down when a new first minister was appointed later this month and return to the backbenches.

Like Ms Sturgeon, the 58-year-old has been in parliament since 1999 and in government since the SNP came to power in 2007.

A former MP, he was the leader of the SNP from 2000 to 2004 before a series of election defeats led to his resignation, and Alex Salmond returned to the helm.

His exit is further evidence of a generational shift in the SNP which includes Ms Sturgeon's replacement and Stephen Flynn replacing Ian Blackford as Westminster leader.

In her reply to Mr Swinney, Ms Sturgeon said the pair would "move to the backbenches and make way for the new generation who will now lead Scotland forward”.

Mr Swinney, the MSP for Perthshire North, is the longest serving Deputy First Minister on record, having held the post for almost nine years.

He also served as Education Secretary, with two stints as Finance Secretary, the second while Kate Forbes in on maternity leave.

Ms Forbes said: "I have such respect and admiration for John Swinney.

"John Swinney is not only an incredibly able politician who's put public service at the heart of his career, he's also somebody who I'd call a friend and is a friend to so many MSPs and I have valued enormously his advice and guidance over the years and I wish him well because he has put in some shift."

Her rival in the SNP leadership race, Health Secretary Humza Yousaf, said it had been "an absolute honour to serve in cabinet alongside Mr Swinney.

He said: "John is a true giant of the SNP and the independence movement.

“Our party and our government owe much of our success to John’s hard work, from securing the council tax freeze in the early days of government, to expanding childcare as Education Secretary, finding the funds to help households through the cost of living crisis and enabling me to deliver fair pay for our NHS in recent weeks.

“John has long represented the good in our politics. His ability to win the respect of people from all political persuasions whilst passionately advocating his cause is an example everyone in politics should aspire to.

“On a personal level he has always been a source of advice and support to me in good times and bad, from my days as a young activist to becoming colleagues around the cabinet table.”

In a letter to Ms Sturgeon, Mr Swinney said it had been an “honour to serve Scotland” and that he has always sought “to transform the life chances of everyone”.

Ms Sturgeon paid tribute to Mr Swinney’s “deep care and attention to the wellbeing of our nation” and says she could not have wished for a better “partner in government”.

Mr Swinney wrote: "It has been the privilege of my life to serve in the Scottish Government since 2007 as a Cabinet Secretary with responsibility first for Finance and the Economy, then Education and Skills and finally Covid Recovery. It has been my honour to serve Scotland as your Deputy First Minister since 2014.

“These have been demanding commitments to fulfil over nearly 16 years and I have decided that, when the First Minister is appointed later in March, I will stand down from government.

“When I joined the Scottish National Party at the age of 15 in 1979, our political prospects were poor and I could scarcely have imagined that over so many years I would have the opportunity to serve Scotland in government in the way I have.

“In all that I have undertaken in government, I have tried to listen carefully to different views and be open to the ideas and thoughts of people in Scotland. 

“I have sought always to transform the life chances of everyone who lives here. I have acted to make Scotland a fairer, more prosperous and more confident country that I believe would be assured with Independence.

“I have been touched constantly by the kindness of people in Scotland and their understanding of the many challenges with which we have to wrestle in Government. 

“I will continue to faithfully represent my constituents in Perthshire North and look forward to sitting with you on the back benches of the Scottish Parliament to continue our contribution to Scotland’s cause.

“Thank you for the opportunity you have given me to serve my country.”

In her reply, Ms Sturgeon said Mr Swinney's contribution to the nation was"considerable, indeed unique" and while she understood it, she felt "a real sense of sadness".

She said: "As Finance and Economy Secretary in our newly formed Scottish Government in 2007, you steered us successfully through budget after budget, laying the foundations for a long list of policy successes.

“You were also the architect of a new partnership with local government, and helped negotiate a a new financial settlement with the UK Government, the Fiscal Framework, rebuffing in the process attempts to strip Scotland of funding.

“As Education Secretary, you piloted reforms that are now delivering progress in our mission to close the attainment gap. You presided over an increase in teacher numbers and opened university education to record numbers of young people from the poorest backgrounds.

“Perhaps most significantly for the long-term, you delivered the biggest expansion in early learning and childcare in our country’s history - a transformation that will change the lives of future generations of children for the better.

"From a more personal perspective, your friendship and wise counsel during the pandemic, which was by far the most challenging period of my tenure as First Minister, was invaluable and helped me through some really tough days.

“Bringing to bear all your experience of government – and the deep care and attention to the wellbeing of our nation that I know you feel – you helped protect thousands from the full impact of the cost of living crisis.

"Securing funding for the expansion of the game-changing Scottish Child Payment was the most important of many initiatives.

“In short, I could not have wished for a better partner in government than you, and there is no doubt that our Scottish Government would have achieved much less had you not been in it.

“Please accept my thanks for your support, wisdom and, above all, friendship as together with Ministers past and present, we sought to make Scotland a better place.

"As I said when I announced my own departure from office, serving as First Minister has been the privilege of my life - having done so with you by my side as Deputy First Minister has been an honour.

“As for the future, I know you will continue to serve Scotland well and that you will be, as you always have been, a source of good advice and wise counsel to our party, government and movement.

"I look forward to this new phase - for both of us - as we move to the backbenches and make way for the new generation who will now lead Scotland forward.” 

Scottish Tory deputy leader Meghan Gallacher MSP said: “John Swinney has jumped before he was pushed. He knows that a new First Minister will mean a reshuffle, which would have led to his sacking.

“The fact that the Deputy First Minister, one of the SNP’s most senior figures, felt he had to resign before he was sacked shows how bitter and divided the leadership contest has made this Nationalist government.

“As the SNP obsess about their internal debate on independence, the Scottish Conservatives will continue to focus on the real priorities of the Scottish people.”