The 16-year-old boy had allegedly wounded the teenager he claimed had bullied him, fired two more rounds at students fleeing their first-period science class, and then faced a teacher and school counsellor.

"I don't want to shoot you," the teen told the popular teacher, Ryan Heber, who was trying to coax the teen into giving up the shotgun he still held.

Recounting the suspect's words, Kern County Sheriff Donny Youngblood said the confrontation was enough of a distraction to give 28 students time to escape their classroom Thursday at a Taft, Calif., high school on Thursday.

The violence came just minutes after administrators had announced new lockdown safety procedures prompted by the Newtown, Conn., school shooting last month, when a gunman massacred 20 children and six women before killing himself.

The Newtown shooting prompted U.S. 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.

Minutes before the California shooting, the teachers "were giving us protocol because of what happened in Connecticut," said student Oscar Nuno, who was across campus from the science building at Taft Union High School when an announcer on the PA system said the school was under lockdown "and it was not a drill."

Pockets of ammunition

The teen victim, whose classmates said played for the school's football team last year, was in critical but stable condition at a local hospital Thursday night. He was expected to undergo surgery on Friday.

The suspect surrendered his shotgun to Heber and campus supervisor Kim Lee Fields. His pockets were stuffed with more ammunition, said Youngblood.

"This teacher and this counsellor stood there face to face not knowing if he was going to shoot them," Youngblood said. "They probably expected the worst and hoped for the best, but they gave the students a chance to escape."

Parents and students gather outside Taft Union High School in Taft, Calif., after a shooting on Thursday morning. (Alex Horvath/The Bakersfield Californian/Associated Press)

Heber's forehead had been grazed by a stray pellet, but Youngblood said the teacher, who graduated from the Taft school two decades ago, was unaware he had been hit.

"He's the nicest teacher I know," Nuno said. "He loves his students and he always wants to help."

The shooting shocked residents of the remote town of 9,400 that sits amid tumbleweeds and oilfields about 193 kilometres northwest of Los Angeles.

'A smart kid'

"We know each other here," said former mayor Dave Noerr. "We drive pickups and work hard and hunt and fish. This is a grassroots town. This is the last place you'd think something like this would happen."

The 16-year-old's name is on the lips of everyone in town, but authorities aren't releasing it because he's a juvenile. He had felt bullied by the victim for more than a year, said Youngblood, who added that the claim was still being investigated.

Trish Montes described her neighbour as "a short guy" and "small" who was teased about his stature by many.

Montes said her son had worked at the school and tutored the boy last year.

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

On Wednesday night, the teen went home and plotted revenge, Youngblood said. He found a gun that authorities believe belonged to the suspect's older brother, and went to bed that night plotting revenge against two students.

"He planned the event," Youngblood said. "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."

Attempted murder charges

The suspect arrived after 9 a.m. PT, and video surveillance cameras captured him looking nervous as he entered through a side door, Youngblood said. He made his way to the second floor of the school's science building, where Heber's class with 28 students inside was under way.

The suspect walked in a door close to the front of the classroom and shot his classmate. When the shots were fired, 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.

"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 teacher's father, David Heber, told the Bakersfield Californian that he had heard rumours of a school shooting but wasn't initially worried that his son's classroom would have been involved.

"His students like him a whole bunch," said Heber, 70. "He's not the kind of teacher a student would try to hurt. He's definitely someone who could talk a kid down in an emergency."

Youngblood said that the suspect would be charged with attempted murder. The U.S. district attorney will decide whether he's charged as an adult, Youngblood said.

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

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

The school will be closed Friday as investigators continue to search the building. Authorities are "searching every backpack, every book," Youngblood said, to make sure the suspect acted alone.