The youth who carried out the fatal attack on Bailey Gwynne was warned about taking knives to school years before the incident.
Head teacher Anna Muirhead was the first witness to give evidence at the teenager’s murder trial at the High Court in Aberdeen.
She said although he was not normally one to cause trouble, and was seen as a “bit of a loner”, she had previously found herself having to lecture him about the dangers of offensive weapons.
The court heard Ms Muirhead was one of the first people to see the accused after he stabbed Bailey through the heart on October 28.
The families of both boys sat at opposite ends of the public benches yesterday as the court heard how Bailey collapsed under a TV screen near the main entrance to Aberdeen’s Cults Academy.
Ms Muirhead said the teenager had appeared “distraught” when he realised the assault was serious.
And as she approached him, she said he started to tell her “it’s my fault” as Bailey lay on the ground dying nearby.
When asked by advocate depute Alex Prentice how the accused seemed after the incident, she said: “He was sitting side-on to the seat and slightly curled up. He was obviously distraught or upset at least.
“I said to him ‘what’s up?’ or something to that effect. He indicated with his head and his hand round the corner and said ‘that was me, that was my fault’.”
Ms Muirhead added: “I took about one step and saw Bailey lying on the ground underneath the TV screen and various members of staff kneeling beside him.”
Mr Prentice asked her how Bailey seemed.
She replied: “I knew immediately that it was very, very serious. It was his colour, just the general sight.
“He was very, very pale. By that time he had his shirt open and I could see a lot of his body, I thought it was very, very serious.”
Ms Muirhead said that while she waited for an ambulance to arrive she asked the accused to come with her.
She said: “He was very agitated and said ‘no, just take me to the police’.”
The court also heard evidence from Alisdair Sharp, a computing teacher, who said he broke up the fight between Bailey and the accused.
He said he noticed a small bit of blood on Bailey and was on his way to get him some first aid when the teenager stumbled and fell into a wall.
He said that as Bailey collapsed, after having walked about 50 yards, the accused made his way to the injured teenager’s side to try to help him.
Mr Sharp, 28, said that as he saw the trail of blood along the corridor that Bailey had left behind him he started to panic.
He said: “I was walking ahead of the two boys as I got towards the end of ‘the street’ I turned round to see Bailey staggering towards the wall.
“Bailey was staggering towards the wall with his arm up, staggering forward. The accused was behind him looking like he was going to help him.
“Bailey made it to the wall and looked very pale. At this point I noticed the trail of blood all the way along ‘the street’.
“He became very pale. There was a lot of blood coming out of him. To begin with he seemed fully coherent but as events unfolded he began to lose consciousness.”
Mr Prentice asked the teacher what steps he took to help save Bailey.
He replied: “After moving him towards the floor I panicked to be honest. I did not do much to help Bailey beyond that point.”
The court heard other adults arrived on the scene moments later and started to apply pressure to Bailey’s wound until the ambulance arrived.