A 14-year-old stabbed his teacher and then boasted about it in a "sick" Facebook post which was "liked" by 69 people.
The reaction to the boy's Facebook message, posted after the racially motivated attack on Vincent Uzomah at Dixons Kings Academy, in Bradford, was described as an "appalling reflection" of society by Judge Jonathan Durham Hall QC.
The teenager was handed an 11-year extended sentence at Bradford Crown Court after he admitted causing grievous bodily harm with intent to the teacher.
Judge Durham Hall criticised the response to the post on the social media site, which read: "The motherf***** getin funny so I stick the blade straight in his tummy."
He said: "It's an appalling reflection on a small microcosm of our society that within minutes or hours after posting, 69 people 'liked'. How sick."
Judge Durham Hall described the attack as "utterly shocking" and told the boy he had "deliberately and callously" stabbed his teacher.
He said: "You went to your school armed with a knife with a significant blade intending, when the opportunity presented, to stab your teacher Vincent Uzomah.
"You boasted about it before, you boasted about it after when you had stabbed him."
He told the boy, who sat in the dock with his arms folded and yawned continuously throughout the sentencing, he "stabbed him deliberately then gloated in the presence of your classmates".
The court heard the attack, on June 11, was racially motivated.
Jonathan Sharp, prosecuting, said: "He did not show any especial hostility to other teachers. Mr Uzomah, however, is black.
"The defendant disliked him, claiming he couldn't teach, and freely referred to him by the epithet beginning with the letter N, including saying it in anger just before he attacked him."
Judge Durham Hall said: "Suggestions you were calling him a n****r and the inference I must draw is that was a factor. You could not tolerate being told off by this gentleman of this background."
Mr Uzomah, who sat with his wife Uduak in court and listened to the proceedings, said he had forgiven his attacker, who was described by classmates as "disruptive and a bully".
The 50-year-old thought he was going to die after the attack, which left him needing hospital treatment for injuries to his stomach and bowel.
The court heard the boy had taken a dislike to Mr Uzomah during the seven weeks he had worked at the school.
The teenager, who has previous convictions and was on bail at the time of the attack, told a friend the previous day that he was planning to stab a teacher.
On the day of the attack, he took a knife into the school and discussed his plans with other pupils.
He stabbed Mr Uzomah after the teacher asked him to surrender his mobile phone.
The teenager then fled and posted about the attack on Facebook 20 minutes later. He was arrested that afternoon.
He gave police a statement, which read: "I am really sorry for stabbing my teacher. I do not know what is wrong with me. I do know I did not intend to kill him. I want to say sorry to Mr Uzomah and I hope he is feeling better soon."
Mr Sharp said the pre-planned attack had left Mr Uzomah with physical and psychological injuries.
He said: "It was also shocking and profoundly distressing to Mr Uzomah that the youth posted a Facebook update boasting of what he had done. This subsequently received 69 'likes' from the youth's circle of acquaintances."
Detective Superintendent Simon Atkinson, of West Yorkshire Police, said the teenager showed no concern for Mr Uzomah by fleeing the scene.
He said: "He worryingly showed a further lack of remorse towards his victim by boasting about his actions on social media."
The 11-year extended sentence includes six years in custody and a further five years on licence. The teenager will serve half of the six years before being released on licence.
Judge Durham Hall rejected an application for the youth's identity to be made public, saying the 14-year-old's "welfare must come first and the public interest must give way".