Speaking at the official opening of the school the First Minister said: "I'm absolutely delighted to join Orkney Islands Council and the pupils of Kirkwall Grammar School to officially open their new school buildings.
"I've been able to see for myself the high standard of the new buildings, and this has been recently echoed by inspectors as being ‘outstanding'.
"Young people from Orkney and nearby islands will be able to develop their skills in top rate educational facilities, including a fantastic new theatre, hair dressing salon, state of the art classrooms and an abundance of social space for the young people.
"This new school in Kirkwall is the result of a fantastic partnership between Orkney Islands Council and the Scottish Government, working together to deliver first class educational accommodation for our young people. I wish the school and everybody in it all the best for the future."
Councillor Janice Annal, Chair of Orkney Islands Council's Education, Leisure and Housing Committee, said: "The Schools Investment Programme was a hugely important project which has improved the quality of education provision in Orkney.
"Everyone who comes through the door of the new Kirkwall Grammar School is hugely impressed with the quality of the design and the ambience. I'm confident that this building provides a learning environment second to none for pupils and teachers both now and in the years to come."
Kirkwall Grammar School head teacher Sheila Dick said: "We are delighted with the new school. The whole school community has been lifted by the building which is light, airy and spacious.
"Break out spaces, double classrooms, a superb theatre and outstanding PE facilities are just some of the features that make KGS a superb learning and teaching environment. The foresight of the Scottish Government and Orkney Islands Council in funding this wonderful building is to be commended."
Donald Mclachlan, Regional Director for Morrison Construction, said: "Everyone is just so positive about the new building and today is about celebrating the new school and showcasing the fantastic work being done within its exciting spaces.
"It has been a hugely collaborative project and we are tremendously proud to have played our part in designing and building the Kirkwall Grammar School for Orkney Islands Council and for the students, parents, staff and the wider community."