Mr Harvey shouted "die, die, die" during the attack, the court heard
A teacher who attacked a 14-year-old pupil with a dumbbell has been given a two-year community order.
Peter Harvey, 50, who hit the boy at All Saints' Roman Catholic School, Mansfield, in July 2009, pleaded guilty to grievous bodily harm without intent.
The boy, a known troublemaker at the school, suffered a fractured skull.
The science teacher, who was signed off with depression for several months, was found not guilty of attempted murder at a trial at Nottingham Crown Court.
The court heard Harvey had been mocked by pupils moments before the attack and had shouted "die, die, die" as he bludgeoned the boy with the weight after the pupil swore at him.
You were undoubtedly suffering from depression, stress and a serious lack of confidence
Judge Michael Stokes QC
It emerged during the four-day trial that pupils at the school were trying to wind up Harvey so his reaction could be caught on a camcorder being used secretly by a girl in the class.
The footage was then to be passed around the school as a way of "humiliating" the teacher.
Harvey's lawyer argued that he was in such a state when he battered the boy that he could not have possibly intended to kill or seriously harm him.
In December 2008, the teacher told the school's education advisor that he had had thoughts he would harm someone.
He was signed off sick for nearly five months and given counselling sessions by a therapist who told him he was too "peaceful and passive" and needed to be better at letting his anger out.
He then returned to work in April last year, reportedly feeling much better.
Passing sentence, Judge Michael Stokes QC said: "On any view this is a tragic case.
"You are a thoroughly decent man and for well over 20 years you have been a dedicated and successful school teacher.
His career, a job at which he excelled and which he loved, is in ruins
Chris Keates NASUWT General Secretary
"In previous years you would have handled this easily and professionally but in July of last year you were far from well.
"You were undoubtedly suffering from depression, stress and a serious lack of confidence."
Chris Keates, General Secretary of the NASUWT union, said his employers at the school and Nottinghamshire County Council were seeking to dismiss the teacher rather than support his application for retirement because of illness.
She said: "His career, a job at which he excelled and which he loved, is in ruins. The sentencing today does not end Mr Harvey's ordeal."
The county council said: "The governing body of All Saints School is dealing with the employment issues under their own internal procedures.
"It would therefore be inappropriate to discuss the details of Mr Harvey's employment as these procedures are still under way."
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.