The 9mm handgun was found Tuesday at Imagine School in North Port in a backpack belonging to a 13-year-old boy, the Sarasota Herald-Tribune reported. School officials said the boy told them he got it from a 12-year-old friend.
Both boys have been arrested and suspended, the school said. They could be expelled for a year.
Principal Justin Matthews said school staffers got a tip from another student about the gun being on the school's Upper Campus, which is for students in grades 6-10.
"It's a huge win," he said. "We were able to catch it before anyone got hurt."
In a letter to parents, Matthews credited the school's "close-knit family culture" for the tip.
"Parents, it is imperative to regularly check the status of all firearms in your home in order to prevent such events as these to occur," he said. "Additionally, we encourage you to continue to advise your children to let school staff know in the event they learn of a potential issue at school."