The boy called police to Higham Lane School on Shanklin Drive, Nuneaton, at 09:15 BST on Tuesday.
He was arrested on suspicion of being in possession of a firearm.
One family of a pupil at the school said they had been “petrified”. Officers stayed for the rest of the day to reassure pupils, Warwickshire Police said.
Supt David Gardner said: “We responded promptly and the boy was quickly isolated and the incident contained to ensure there was no risk to pupils and staff.
“The initial report was received from the suspect himself and he was co-operative with police throughout.
“Officers were on the scene quickly and he was placed under arrest.
“I would like to thank staff and pupils at the school for their assistance while we managed this incident.”
Annette Roberts has a grandchild who attends the school.
She said her daughter had received a text from the school saying there had been an incident but police said it was safe for the children to remain at school.
“Obviously we’ve been absolutely petrified and it wasn’t until my daughter said ‘look on Warwickshire Police [website] ‘ and there it was.
“I understand they’ve got a lot of things to cope with, but the way things are now in the world, everything comes to mind.”
[Source:- bbc]