San Bernardino Police Chief Jarrod Burguan said on Twitter that four victims were being treated in what investigators suspect was a murder-suicide.
The shooting happened at the North Park School. Students gathered on a field near a line of school buses and other vehicles, including fire trucks. The scene was not chaotic, but police stood nearby.
She says all other students are safe and they are being taken to a local college campus.
The city of 216,000 was the site of the December 2015 terror attack that killed 14 people and wounded 22 others at a meeting of San Bernardino County employees. Husband-and-wife shooters Syed Rizwan Farook and Tashfeen Malik were killed in a gunbattle with authorities later that day.
The city is known for its high rates of violent crime, especially homicides, and has struggled to emerge from bankruptcy.