The teenager told the court the bullying had affected how he controls his temper and said: “I’m upset all the time.”

The defendant’s barrister, Gul Nawaz Hussain KC, asked him about social media.

The boy said he had been bullied online by “strangers” and by pupils at All Saints.

The barrister asked him: “When bullying was happening on social media, did you feel you could get away from it?”

The boy said no.

When Mr Hussain asked him about the worst threat he had received on social media, the defendant replied: “Someone said, ‘I’ll stab you up’.”

The defendant said he began to believe the threats and, when his barrister asked “how did that make you feel?”, the boy said: “Scared.”