Scottish First Minister Nicola Sturgeon has announced the make-up of her new senior ministerial team, with an equal split of male and female members.
Finance Secretary John Swinney was named deputy first minister, while Ms Sturgeon's close ally Shona Robison, was promoted to health secretary.
Michael Matheson was named as the new justice secretary, replacing Kenny MacAskill.
Mike Russell was replaced as education secretary by Angela Constance.
Opposition parties said the new cabinet now had to tackle the problems brought about by previous bad decisions.
The reshuffle also resulted in:
- Roseanna Cunningham promoted into the cabinet as fair work, skills and training secretary.
- Keith Brown promoted into the cabinet as infrastructure, investment and cities secretary
- Alex Neil staying in the cabinet, but moving from health to social justice, communities and pensioners' rights
- Richard Lochhead remaining environment secretary, a post he has held since the SNP came to power in 2007
- Fiona Hyslop remaining as secretary for culture, Europe and external affairs
Ms Sturgeon said: "The aims of my government are clear: to create a nation that is both socially democratic and socially just, a nation that is confident in itself and governed effectively and a nation which will address poverty, support business, promote growth and tackle inequality.
"The new cabinet team I have announced today will pursue these priorities with verve, vigour and determination."
The first minister added: "Every member of the cabinet is part of this government's top team on merit, on the basis of the excellent work they have already done as ministers.
"The cabinet line-up is also a clear demonstration that this government will work hard in all areas to promote women, to create gender equality and it sends out a strong message that the business of redressing the gender balance in public life starts right here in government."
Ms Sturgeon began her reshuffle by announcing Mr Swinney's new job on Twitter.
Mr Swinney, who led his party between 2000 and 2004, responded: "It is the greatest privilege for me to be appointed deputy first minister of Scotland. I will do all I can to serve my country."
Following Ms Sturgeon's earlier offer to work with opposition parties on improving Scotland, Labour MSP Jackie Baillie said: "I look forward to them supporting Labour's policies to tackle the many problems that their predecessors have left for them.
"It's time to put the referendum result behind us and get on with governing the country for the benefit of the people of Scotland."
By Andrew Black, BBC Scotland political reporter
The make-up of Nicola Sturgeon's first cabinet had been the subject of huge speculation, almost since the day it became clear she would be the only candidate to succeed Alex Salmond.
As the first minister announced her top ministerial team, it became clear some of the speculation was correct.
Two big SNP names - Kenny MacAskill and Mike Russell - have gone as justice and education secretaries respectively.
Both these jobs are high-profile and the two men who did them have each had to contend with bringing in controversial policies, whether that be changes to the sheriff court system or reforms of the college sector.
In terms of who's in, John Swinney was named deputy first minister and Shona Robison was appointed to health. Both those moves were widely predicted, although Ms Sturgeon has made clear that everyone in her team is there on merit, based on their achievements as ministers.
Angela Constance and Keith Brown - who both stood unsuccessfully for the SNP deputy leadership - also landed senior posts.
And, in something of a surprise announcement, Michael Matheson rises from the junior ministerial ranks to take Mr MacAskill's old job.
Ms Sturgeon is also seeking to reinforce her message with a cabinet made up of a 50-50 gender split - another move which didn't come as a complete surprise - that equality will be central to her programme for government.
Willie Rennie, the Scottish Liberal Democrat leader, said the new cabinet needed a new approach.
Mr Rennie attacked Mr MacAskill's handling of plans to end the requirement to corroborate evidence in criminal trials, as well as the "routine" arming of police and the carrying out of stop-and-search procedures on children.
"Nicola Sturgeon likes to talk liberal, but the real test is whether she'll walk liberal," he said.
"The SNP cabinet stood behind Kenny MacAskill's illiberal centralisation agenda at every twist and turn."
Scottish Conservative deputy leader Jackson Carlaw said: "We wish the new incumbents the best in their roles.
"As long as they pursue policies which support hardworking people and boost aspiration, they will have the support of the Scottish Conservatives.
"It's right that those who were ousted from the cabinet, Kenny MacAskill and Mike Russell, did so as their time was up long before this reshuffle.
"It's also worth noting that a cabinet of six was fine in 2007. But with all those SNP MSPs to keep happy, it now seems that taxpayers need to pay for 10."
Ms Sturgeon also announced her junior ministerial team:
- Minister for Business, Energy and Tourism - Fergus Ewing
- Minister for Parliamentary Business - Joe Fitzpatrick
- Minister for Transport and Islands - Derek Mackay
- Minister for Youth and Women's Employment - Annabelle Ewing
- Minister for Children and Young People - Aileen Campbell (During Ms Campbell's maternity cover, Fiona McLeod will serve as acting Minister for Children and Young People)
- Minister for Learning, Science and Scotland's Languages - Alasdair Allan
- Minister for Public Health - Maureen Watt
- Minister for Sport and Health Improvement - Jamie Hepburn
- Minister for Local Government and Community Empowerment - Marco Biagi
- Minister for Housing and Welfare - Margaret Burgess
- Minister for Community Safety and Legal Affairs - Paul Wheelhouse
- Minister for Environment, Climate Change and Land Reform - Aileen McLeod
- Minister for Europe and International Development - Humza Yousaf
Meanwhile, Scotland's senior law officers, Lord Advocate Frank Mulholland and Solicitor General Lesley Thompson, will continue in their current jobs.