A custodian at Warren T. Eich Middle School in Roseville found a homemade explosive on campus early Friday morning, police said.
The device, reportedly made from common household cleaning products, exploded near the custodian. Investigators say the man was not injured.
A second device was also found on campus, but was apparently a dud.
Students were kept off campus until police deemed it safe, officers said.
"It's surprising and a little shocking and I am thankful, A: that no one was hurt, B: law enforcement reacted so quickly and that we were able to get school going today and kids could be here," district Superintendent Derk Garcia said.
Investigators are looking through the school's surveillance footage in hopes of catching the person responsible.
Police say an officer will stay on campus through Friday.