The incident happened at an outdoor assembly recognizing "Red Ribbon Week" at Newman Elementary School in Chino.
Police said a student approached a police motorcycle that was on display and pulled the trigger of an AR-15 rifle that was locked into a weapons mount on the side of the motorcycle. The rifle was never removed from the mounting device.
Police say two boys suffered minor injuries when they were struck by metal debris that came from the bullet disintegrating as it hit a metal plate where the barrel rests against the weapons mount. According to officials, that's meant to be a fail safe measure, which worked.
A third student was assessed at the school and released to parents.
"When I heard it, I heard a big bang," said 11-year-old Leo Castaneda.
Castaneda says right before the gunshot, Chino police officers were hanging out with students as part of the drug prevention campaign activities.
"The cops were playing with the kids...and giving out stickers and they weren't watching the armor, so the kid got hold of the gun and he shot it at the ground and he got startled by the noise and dropped it and started running through the field," said Castaneda.
Police say they are trying to figure out how a young child was able to get access to the weapon. Many parents say they're just grateful no one was seriously injured or killed.
"You know, things happen. It's kind of strange a gun would have been accessible or not cleared prior to doing a demonstration," said Tim Everman, a father.
The Chino Police Department released a statement saying it is "conducting a thorough investigation into this matter in full cooperation with the Chino Valley Unified School District."