Police are questioning a teenager after a "gentle and caring" pupil died in a stabbing at a school.
Bailey Gwynne, 16, suffered serious injuries in the attack at Cults Academy, in west Aberdeen, at around 1.30pm on Wednesday.
He died a short time later at the city's Royal Infirmary, sparking a murder investigation by police.
A teenage boy, also 16, was detained by police after the incident and has been helping them with their inquiries.
Head teacher Anna Muirhead said the school community is "totally devastated" and in shock following the teenager's death.
She 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."
The incident is thought to have happened at lunch-time in a communal area known as The Street.
Pupils reportedly described how the corridor was covered in blood after the incident.
One youngster quoted in the Scottish Sun said: "It was horrible, there was blood everywhere."
Teachers were also said to have fought to save the injured boy, who was reported to have been stabbed in the stomach.
Parents rushed to the secondary school to pick up their children after news of the attack emerged.
Counselling is being made available to pupils and staff at the school, which has been closed for the rest of the week, and a dedicated phone line has been set up for those affected, on 01224 264299.
A candle-lit vigil will be held on Thursday night at Cults Parish Church, North Deeside Road, the Church of Scotland said.
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 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."
Police Scotland have not formally named the teenager but said his family have 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."
A steady stream of pupils visited the school gates late on Wednesday to leave floral tributes, many visibly shocked and tearful.
People connected with the school also took to social media to pay tribute to the teenager and express their shock.
A Facebook page has been set up in tribute to the pupil, titled RIP Bailey Gwynne.
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.''
The school is in an affluent suburb of Aberdeen and has more than 1,000 pupils. It has a good reputation and is described 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.