A security guard at Kendall's Somerset Academy Bay School left a loaded weapon in a bathroom, which was found by a child, the principal said.
A fifth-grade student on Friday reported finding the firearm in the bathroom to his teacher, who immediately notified school administration.
The charter school terminated its contract with the security firm to which the guard was employed.
"The weapon was immediately removed. No child or faculty member was injured," principal Saili Hernandez wrote in a statement to parents. "The security guard was immediately asked to leave and will not be returning to our school. As both a principal and a parent of students at this school, ensuring the safety and well-being of students here is my number one priority."
Hernandez said the school is confident that what happened was an isolated incident, adding that the situation showed that the school's "If You See Something, Say Something" safety policy succeeded.