The teen victim was in critical but stable condition, and the suspect, whose pockets were stuffed with ammunition, was still being interrogated, Kern County Sheriff Donny Youngblood said at a news conference Thursday evening.
The suspect used a shotgun that belonged to his brother and went to bed Wednesday night with a plan to shoot two fellow students, 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, Youngblood said. Campus supervisor Kim Lee Fields responded to a call of shots fired 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," 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," the sheriff said. "They knew not to let him leave the classroom with that shotgun."
The shooter didn't show up for first period, then interrupted the class of 28 students.
Youngblood said the suspect alleges the two students he targeted had bullied him for more than a year, but the sheriff couldn't confirm the allegations.
"Certainly he believed that the two people he targeted had bullied him, in his mind. Whether that occurred or not we don't know yet," Youngblood said.
Youngblood did not release the student's disciplinary record, saying he didn't have it.
The shotgun is believed to belong to the boy's brother and was in the boy's home, Youngblood said.
The Sheriff's Department did not release the boy's name because he was a juvenile and had yet to be charged. But many students and community members said they knew the boy and said he was often teased, including Alex Patterson, 18, who went to Taft with the suspect before graduating last year.
"He comes off as the kind of kid who would do something like this," Patterson said. "He talked about it a lot, but nobody thought he would."
Trish Montes, who lived next door to the suspect, said he was "a short guy" and "small" who was teased about his stature by many, including the victim.
"Maybe people will learn not to bully people," Montes said. "I hate to be crappy about it, but that kid was bullying him."
Montes said her son had worked at the school and tutored the boy last year, sometimes walking with him between classes because he felt sorry for him.
"All I ever heard about him was good things from my son," Montes said. "He wasn't Mr. Popularity, but he was a smart kid. It's a shame. My kid said he was like a genius. It's a shame because he could have made something of himself."
The wounded student was flown to a hospital in Bakersfield and was listed in stable but critical condition Thursday evening. Officials said a female student was hospitalized with possible hearing damage because the shotgun was fired close to her ear, and another girl suffered minor injuries during the scramble to flee when she fell over a table.
Officials said there's usually an armed officer on campus, but the person wasn't there because he was snowed in. Taft police officers arrived within 60 seconds of first reports.
Bakersfield television station KERO reported receiving phone calls from people inside the school who hid in closets. About 900 students are enrolled at the high school, which includes ninth through 12th grades.
Wilhelmina Reum, whose daughter Alexis Singleton is a fourth-grader at a nearby elementary school, got word of the attack while she was about 35 miles away in Bakersfield and immediately sped back to Taft.
"I just kept thinking this can't be happening in my little town," she told The Associated Press.
"I was afraid I was going to get hurt," Alexis said. "I just wanted my mom to get here so I could go home."
Taft is a community of fewer than 10,000 people amid oil and natural gas production fields about 120 miles northwest of Los Angeles.
The attack there came less than a month after a gunman massacred 20 children and six women at Sandy Hook Elementary School in Newtown, Conn., then killed himself.
That shooting prompted 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.
Sen. Dianne Feinstein, D-Calif., said in a statement that her father had attended Taft Union and she has visited the school over the years.
"At this moment my thoughts and prayers are with the victims, and I wish them a speedy recovery," Feinstein said. "But how many more shootings must there be in America before we come to the realization that guns and grievances do not belong together?"
The Associated Press contributed to this report.