WEST PALM BEACH, Fla. -- A loaded handgun fell out of a kindergartner's backpack in a Florida charter school classroom, but it didn't fire and it is unclear how it got there.

Palm Beach County Sheriff's spokeswoman Teri Barbera said the 6-year-old child's teacher at Somerset Academy Lakes Elementary School immediately picked up the gun after it fell Thursday morning and escorted the children out of the classroom. She said no students were endangered at the West Palm Beach School.

Principal Clint Duvo said in a statement the child didn't know how the gun got into the backpack and had no intention of bringing it to school.

Sheriff's detectives are investigating.

The school opened in 2016. Somerset Academy is a large charter school company with sites throughout Florida.