A warehouse worker terrified children by chasing a man into a crowded school classroom – yelling threats and swearing, a court heard.
Pupils were shepherded out of the fire exit while Ryan Taylor looked through a window into Dronfield Junior School, a judge was told.
He was “very aggressive and strutted around,” said Andrew Vout, prosecuting at Derby Crown court on Wednesday.
The incident began as the youngsters returned from a PE session at 3.15pm on July 10.
A man entered in an effort to avoid Taylor, 25, of Carr View, Dronfield.
He told staff: “I need to be here to be safe. I can’t leave because he will kill me.”
Taylor could be heard shouting: “Get yourself out of there. We can sort this out. What are you doing in there?”
Mr Vout said: “The teacher remonstrated about the language and the behaviour in front of a class of children.”
When the other man finally left, he managed to resist as Taylor tried to pull him to the ground. Police were called and Taylor declined to answer questions.
He admitted common assault and was given a three-month prison term, suspended for two years. He must spend ten days on a probation course.
The court heard that Taylor had recently been put on a drug rehabilitation order for cultivating cannabis and had “responded well.”
Judge Nirmal Shant QC said this had helped to save him from immediate custody. The charge also limited her to a short sentence.
She told him: “It must have been extremely frightening not just for the children but for the teacher. But for the matters mentioned, I would have no hesitation in depriving you of your liberty.
“You are making some progress with your current order. Although I am tempted to deprive you of your liberty, it would be retrograde step to stop the order.
“But if you breach the order, you will be back before the court and will serve those three months.”
David Webster, mitigating, said he accepted it was “an unpleasant” offence. Taylor works a ten-hour day, six days a week at a warehouse.
“In the public interest, this matter is best served by allowing the probation service to carry on its good work,” added Mr Webster.