TAFT, Calif. — A 16-year-old student armed with a shotgun walked into a rural California high school on Thursday, shot one student and fired at others and missed before a teacher and another staff member talked him into surrendering, officials said.

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 Thursday evening.

The suspect used a shotgun that belonged to his brother and went to bed on 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.

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.

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.

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 talked about it a lot, but nobody thought he would, ” Patterson said.

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.”

The wounded student was flown to a hospital in Bakersfield and was listed in stable but critical condition. 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 trying to flee.

Officials said there’s usually an armed officer on campus, but the person wasn’t there because he was snowed in.

Taft is a community of fewer than 10,000 people amid oil and natural gas production fields about 120 miles northwest of Los Angeles.