The 16-year-old was then taken to Aberdeen Royal Infirmary, where he died.
Another pupil, also believed to be 16-years-old, has been detained by police, while a number of police officers remain on the scene.
Chief Inspector Graeme Mackie 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 today.
“A full and thorough enquiry is under way 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.”