A judge has commended the bravery of teachers who disarmed a boy of 13 after he went in to a South Lincolnshire school armed with an air rifle and axe.
The lad was tackled by staff at the school after firing one pellet in to the ground, Lincoln Youth Court heard.
The boy, who can not be named because of his age, had admitted possessing a firearm with intent to cause fear of unlawful violence to another person on 13 November, and having an axe on school premises.
Sentence on the boy had been adjourned for a youth offending report after District Judge Peter Veits admitted he was "concerned" by the events.
Sentencing the boy to a 12 month intensive youth referral order, which means he will return home , the Judge said he wanted to ensure public safety and stop the boy committing similar offences in the future.
District Judge Veits told him: "On the face of it these are a very worrying pair of offences, but I have to remind myself you are not charged with offences related to terrorism.
"You are charged with possession of a weapon, but it is an air weapon. You have no previous convictions, so it is your first time in court.
"You have spent three months in custody on remand, the equivalent of a six month sentence.
"But I still have to look at the justice in this case. There are worrying aspects, about what you have written, why you went in to school that day with an air weapon, sparklers, gaffer tape and the rest.
"You say you intended to frighten not hurt people, fortunately you did not hurt anyone.
"The bravery of the teachers has to be commended, who tackled you and told you to put the gun down. They had no way of knowing what was in your mind, and if they were risking their lives."
As part of the 12 month referral order the boy will be subject to high level supervision, mentoring, reparation work and victim awareness.
The judge added: "What I want to do is to ensure the safety of the public and change what was in your mind with the commission of these offences.
"This means you are going home under strict supervision by the youth offending team"
The judge also made a destruction order for the weapons and other items used by the boy, and ordered his mother to pay £105 costs.
The boy, who had been remanded in to secure local authority care, stood in the dock wearing a navy blue tracksuit.
He was supported by his mother and step father who sat in front of the dock.
Roger Lowther, mitigating, said there was hope for this young man.
Mr Lowther added: "He wants to go home, it has been a salutary experience for him. He will engage and work with whoever he needs to."