Police are continuing to question a teenager after a 16-year-old boy, described as a "gentle and caring pupil", died in a stabbing at an Aberdeen secondary school.
The fifth-year pupil, understood to be Bailey Gwynne, was taken to Aberdeen Royal Infirmary with serious injuries after police were called to Cults Academy in the west of the city at about 1.30pm on Wednesday. He died a short time later in hospital.
A teenager, also 16, was detained by police after the incident and is continuing to help them with their inquiries.
Head teacher Anna Muirhead said the school community was "totally devastated" and in shock following the teenager's death, which police are treating as a murder inquiry.
Ms Muirhead said: "Pupils and staff are in a state of total shock. The boy involved was a very gentle, caring pupil, with a lot of friends.
"I think it's fair to say the whole school community is totally devastated. At the moment of course our thoughts are all with the boy's close family and his friends and what they must be going through at this tragic time."
'Shocking and extraordinary incident'
Counselling is being made available to pupils and staff at the school which will be closed to pupils today and Friday.
Police Scotland have not formally named the teenager but said his immediate family has been told.
Chief Inspector Graeme Mackie, the local area commander for Aberdeen South, said: "This is a shocking and extraordinary incident for Aberdeen, and firstly our thoughts are with the family and friends of the boy who has sadly lost his life.
"A full and thorough inquiry has been launched and there will be a police presence in the area for the foreseeable future.
"We are working closely with the education authorities and wider community as I am sure this incident will be felt not only in Aberdeen but much further afield."
He told reporters that teams of specially-trained detectives have been interviewing witnesses who are pupils and teachers of Cults Academy.
Aberdeen City Council has set up a dedicated support number, 01224 264299, for those affected by the incident which opens at 8am.
A steady stream of pupils have placed floral tributes at the school gates, many visibly shocked and tearful.
'There's a sense of disbelief'
Nearby Cults Parish Church remained open on Wednesday night to support the shocked community, and will hold a candlelit vigil tonight at 8pm.
Parish minister Rev Ewen Gilchrist, part of the school's chaplaincy team, said: "As word crept out from the school about what had happened I think it's fair to say there's a sense of disbelief.
"We know that bad things happen in this crazy world but we always think of them happening somewhere else.
"This time it's stampeded into our little corner and tonight our thoughts and our prayers are with Bailey's family, a household that must be utterly devastated and bewildered by what's happened, and also with the staff at the school, the teachers and the pupils themselves who were there when this terrible incident happened.
"I did not know Bailey personally, people I've spoken to have spoken very kindly of him, very well of him.
"There will be many, many households affected by this tragedy, we can only offer whatever quiet love and support we can."
Mr Gilchrist said the church offers refuge at a time when people feel helpless.
"There is a sense of uselessness after such an event but it feels right to open our doors to offer a safe place, a quiet place, a place of prayer - whatever people want the church to be. It is warm and safe with friendly faces," he said.
The Rt Rev Dr Bob Gillies, Bishop of Aberdeen and Orkney, said: "Such dreadful events as this impact in the most terrible of ways upon so many people and upon so many families.
"My deepest grief is with all those whose lives have been changed for ever as a result of this death."
'Affluent suburb of Aberdeen'
Scotland's First Minister Nicola Sturgeon tweeted: "All my thoughts are with the family and friends of the young man who has tragically died at Cults Academy."
Cults Academy is in an affluent suburb of Aberdeen and has more than 1,000 pupils. It is described on its website as a six-year comprehensive serving the Lower Deeside area.
The academy has previously topped the Scottish Schools league table on the strength of its exam results.
Holyrood's Education Secretary Angela Constance said: "I'm deeply saddened by this terrible news and my thoughts are with the pupil's family and friends.
"Aberdeen City Council has arranged for support to be available to the school's pupils and teachers. We remain in close contact with the council and stand ready to provide any help that may be needed."
Tributes have flooded in on social media for the teenager.
On Twitter, ?@RoryMcGregor2 wrote: "Condolences to the family and friends of Bailey. Cults Academy won't be the same without you."
Another tribute from ?@AndrewNeill43 stated: "Rest In Peace Bailey."
Meanwhile, @sophiathain stated: "Absolutely horrific news, such an innocent boy's life has been taken. Thoughts go out to Bailey's family and friends."
And ?@annamccluskeyxx said on Twitter: "Can't believe what happened today. RIP Bailey. Thoughts and prayers go out to your family and friends."
A Facebook page has also been set up in tribute to the pupil.