Bailey Gwynne was described as a "very gentle, caring pupil, with lots of friends"
A 16-year-old has been detained by police to "help officers with their inquiries".
Anna 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."
A candlelit vigil is scheduled for 8pm today.
Chief Inspector Graeme Mackie, of Aberdeen Police, said in a statement: "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 today.
"A full and thorough enquiry is underway 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."
Story continues after slideshow...
Cults Academy Stabbing
Cults Academy stabbing(01 of10)
Open Image Modal
Flowers at the gates of Cults Academy in Aberdeen, where a 16-year-old boy has died after being stabbed at the secondary school. (credit:Andrew Milligan/PA Wire)
Cults Academy stabbing(02 of10)
Open Image Modal
People view flowers at the gates of Cults Academy in Aberdeen, where a 16-year-old boy has died after being stabbed at the secondary school. (credit:Andrew Milligan/PA Wire)
Cults Academy stabbing(03 of10)
Open Image Modal
People leave flowers at the gates of Cults Academy in Aberdeen, where a 16-year-old boy has died after being stabbed at the secondary school. (credit:Andrew Milligan/PA Wire)
Cults Academy stabbing(04 of10)
Open Image Modal
A police officer at the gates of Cults Academy in Aberdeen, where a 16-year-old boy has died after being stabbed at the secondary school. (credit:Andrew Milligan/PA Wire)
Cults Academy stabbing(05 of10)
Open Image Modal
A police car passes floral tributes outside Cults Academy in Aberdeen, as they continue to question a teenager after a 16-year-old boy died in a stabbing at the secondary school. (credit:Andrew Milligan/PA Wire)
Cults Academy stabbing(06 of10)
Open Image Modal
Floral tributes are left outside Cults Academy in Aberdeen, as police continue to question a teenager after a 16-year-old boy died in a stabbing at the secondary school. (credit:Andrew Milligan/PA Wire)
Cults Academy stabbing(07 of10)
Open Image Modal
Floral tributes outside Cults Academy in Aberdeen, as police continue to question a teenager after a 16-year-old boy died in a stabbing at the secondary school. (credit:Andrew Milligan/PA Wire)
Cults Academy stabbing(08 of10)
Open Image Modal
Floral tributes are left outside Cults Academy in Aberdeen, as police continue to question a teenager after a 16-year-old boy died in a stabbing at the secondary school. (credit:Andrew Milligan/PA Wire)
Cults Academy stabbing(09 of10)
Open Image Modal
Local Church of Scotland minister, Euen Gilchrist, from Cults Parish Church, outside Cults Academy in Aberdeen, as police continue to question a teenager after a 16-year-old boy died in a stabbing at the secondary school. (credit:Andrew Milligan/PA Wire)
Cults Academy stabbing(10 of10)
Open Image Modal
Local Church of Scotland minister, Euen Gilchrist, from Cults Parish Church, outside Cults Academy in Aberdeen, as police continue to question a teenager after a 16-year-old boy died in a stabbing at the secondary school. (credit:Andrew Milligan/PA Wire)
The school will be closed for Thursday and Friday and specially trained officers have been interviewing pupils.