The Mapplewell youngster, who cannot be named due to his age, appeared at Barnsley Youth Court on Tuesday where he pleaded guilty to possessing a blade on a school premises.
Staff at the school - which also cannot be identified but is in the Barnsley borough - acted upon information they received from the boy’s classmate and searched him before police were called.
Chantel Lowery-Green, from the Crown Prosecution Service, said: “The boy was taken into an office, asked about the allegation and said he had a knife in his bag.
“Police were called and the boy told them the same thing as he had told staff - that he was being bullied and had brought the knife in because of that.We say he did not do this to kill anyone, but it was more to do with frightening those who he said were bullying him. The knife was 30cm long and its blade was about half that, 15cm.”
The boy, who was suspended following the incident, was permanently excluded and is now at another school, magistrates were told.
Gus Kennedy, defending, added: “It was an offence which was fairly easily detected - the information was passed on to staff and the boy was straightforward and honest when questioned.
“He named three alleged bullies but it’s clearly a concerning offence. He was suspended while this was investigated and was permanently excluded afterwards.
“He is aware of his age and his lack of previous convictions assists him, but I have impressed on him that this won’t remain if there are further offences, especially of this nature.”
Magistrates were told that there had been a short impasse while it was decided whether or not the matter should be immediately referred to the Barnsley Youth Offending Team (YOT) or if court action was necessary.
Chairing the bench, Lynne Fairbridge gave the boy a nine-month referral order, ordered the forfeiture and destruction of the knife and told his parents to pay a £20 victim surcharge.
“Knife crime is treated seriously whether it’s possession or actually using the weapon,” she told him. “Your actions put you in a position where bullies could have taken it from you and stabbed you.
“We’re here not just to punish people, but to stop them from reoffending as well. This is your first time in court but the more you’re here, the higher risk of prison there is.
“Had you have not pleaded guilty, the referral order would have been longer. If you are bullied again, I now believe you will act differently.”
South Yorkshire Police say there has been an alarming rise in youngsters turning to blades for protection or status, something which officers paid particular attention to during a clampdown on knife crime in Barnsley through Operation Sceptre in the spring.
Chf Supt Una Jennings, force lead for knife crime, added: “It is vitally important that we continue to work together to address the issue of knife crime and make our young people feel safer and, if they are considering carrying a knife, understand why that is and educate them away from this highly dangerous path.
“We’re very clear that when the problem of knife crime comes to the police, someone has already been failed, whether it is the offender or the victim.
“I’m grateful for the support of our partner agencies, schools and communities as we continue our efforts to tackle this.”