Image caption Ms Sturgeon said John Swinney's appointment showed that education was the key priority for her government

John Swinney has become Scotland's new education secretary as part of Nicola Sturgeon's cabinet reshuffle.

Mr Swinney had been Scotland's finance secretary for the past nine years, as well as the country's deputy first minister - a role he will keep.

Former Transport Secretary Derek Mackay was promoted to finance secretary, with Keith Brown becoming economy secretary.

Both roles had previously been filled by Mr Swinney, but have now been separated.

Ms Sturgeon said the appointment of her most experienced minister to the role of education secretary demonstrated how important education was to her government.

The SNP has faced criticism over the attainment gap between Scotland's wealthiest and most deprived pupils, with the country's education system also falling in international league tables.

Image caption There are five men and five women - including first minister Nicola Sturgeon - in the reshuffled Scottish cabinet

The first minister has pledged to create a "world class" education system in Scotland, with every child given the opportunity to fulfil their potential, regardless of their background.

She said: "John's record is exemplary, overseeing a succession of balanced budgets as well as delivering the recent fiscal framework deal that will underpin the new powers being devolved to the Scottish parliament.

"His appointment to this crucial role demonstrates how important education is to my government."

'Challenges and opportunities'

Scotland's largest teaching union, the EIS, welcomed Mr Swinney's appointment, and said it looked forward to working with him on the "significant issues" facing Scottish education.

Meanwhile, Mr Mackay will have responsibility for the Scottish budget and the new tax powers that are due to be devolved to the Scottish Parliament, in a role that has been described as being similar to the UK Chancellor.

Mr Brown - who had been the infrastructure secretary - will be tasked with infrastructure projects, securing investment and supporting people into work, similar to the UK government's business secretary.

The first minister had previously said that splitting the two roles was not a reflection on how they had been carried out in the past, but rather a "reflection of the challenges and opportunities we face in the future".

Figures released earlier on Wednesday showed that unemployment has risen in Scotland for the third consecutive month and now stands at 6.2%, compared with 5.1% for the UK as a whole.

Elsewhere in the reshuffle:

Shona Robison remains as the health secretary

Michael Matheson keeps his justice brief

Angela Constance - who had been education secretary - is appointed as the cabinet secretary for communities, social security and equalities

Fiona Hyslop continues as the culture, tourism and external affairs secretary

Roseanna Cunningham becomes cabinet Secretary for environment, climate Change and land reform

Fergus Ewing, who had been energy minister, becomes the rural economy and connectivity secretary.

Two long-standing ministers - Rural Affairs Secretary Richard Lochhead and Social Justice Minister Alex Neil - announced ahead of the reshuffle that they were stepping down from the cabinet.

Ms Sturgeon unveiled her new cabinet after being formally sworn in as first minister in a ceremony at the Court of Session in Edinburgh.

She is to lead a minority SNP government, after the party won 63 of the 129 seats in the Scottish Parliament election on 5 May.

Ms Sturgeon has also announced the government's junior ministers, which include Mark McDonald as the new minister for childcare and early years and Shirley-Anne Somerville as the minister for further education, higher education and science.

Humza Yousaf will take up the responsibilities of minister for transport and the islands, and Paul Wheelhouse has been appointed as minister for business, innovation and energy.

Maureen Watt is the new minister for mental health, and Jeane Freeman the Scottish government's first dedicated minister for social security.

Image caption Nicola Sturgeon was formally sworn in as first minister at the Court of Session on Wednesday morning

Responding to the reshuffle, Scottish Labour said it would hold ministers to account on their record, and called on them to "be bold and use the powers of the Scottish Parliament to stop the cuts and invest in the future".

Patrick Harvie, co-convener of the Scottish Greens, welcomed Fergus Ewing - who was widely regarded as being supportive of fracking - being moved away from the energy brief.

Mr Harvie said: "His successor, Keith Brown, can expect further pressure from Greens and others to turn the temporary moratorium into a permanent ban to protect our communities".

Mr Brown expressed "serious concerns" about fracking during his failed bid for election as SNP deputy leader but backed the moratorium "until we can get a clearer picture of the situation".

Scottish Liberal Democrat leader Willie Rennie, who defied a party conference vote in favour of fracking to advocate a ban in his 2016 manifesto, said: "Shifting Fergus Ewing away from fracking just exposes the fault lines in the SNP on the environment."