A 16-year-old student armed with a shotgun walked into a rural California high school, shot one student and fired at others and missed, before a teacher and another staff member talked him into surrendering.
The teen victim is in a critical but stable condition.
The suspect, whose pockets were stuffed with ammunition, is still being interrogated, Sheriff Donny Youngblood said at a news conference.
The suspect used a shotgun that belonged to his brother and had planned to shoot two fellow students, Mr Youngblood said.
Surveillance video shows the alleged shooter trying to conceal the gun as he nervously entered Taft Union High School through a side entrance after school had started Thursday morning.
When the shots were fired, teacher Ryan Heber tried to get the more than two dozen students out a back door and engaged the shooter in conversation to distract him, Mr Youngblood said.
Campus supervisor Kim Lee Fields responded to hearing the shots and also began talking to the teen.
"They talked him into putting that shotgun down. He in fact told the teacher, ‘I don't want to shoot you,’ and named the person that he wanted to shoot," Mr Youngblood said.
"The heroics of these two people goes without saying. They could have just as easily ... tried to get out of the classroom and left students, and they didn't," he said. "They knew not to let him leave the classroom with that shotgun."
The shooter did not show up for first period, then interrupted the class of 28 students.
Mr Youngblood said the suspect alleges the two students he targeted had bullied him for more than a year, but the sheriff could not confirm the allegations.
The wounded student was flown to a hospital in Bakersfield and is listed as being in stable but critical condition.
Officials said there is usually an armed officer on campus, but the person was not there because he was snowed in.
Taft police officers arrived within 60 seconds of first reports.
About 900 students are enrolled at the high school, which includes ninth through 12th grades.
The attack there came less than a month after a gunman massacred 20 children and six women at Sandy Hook Elementary School in Newtown, Connecticut, then killed himself.
That shooting prompted US President Barack Obama to promise new efforts to curb gun violence.
Vice President Joe Biden, who was placed in charge of the initiative, said he would deliver new policy proposals to the president by next week.