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, then faced teacher Ryan Heber.
"I don't want to shoot you," he told the popular teacher, 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 California high school.
The violence came just minutes after administrators had announced new lockdown safety procedures prompted by the Newtown, Conn., school slayings.
"Just 10 minutes before it happened our 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 lock down "and it was not a drill."
The teen victim, who classmates said played football last year for the Taft Wildcats, was in critical but stable condition at a Kern County 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 counselor 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."
Heber's forehead had been grazed by a stray pellet, but Youngblood said the teacher who had 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 this remote town of 9,400 that sits amid tumbleweeds and oil fields about 120 miles northwest of Los Angeles.
"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 neighbor 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."
The suspect arrived after 9 a.m., 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 rumors 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 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.
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.
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.
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.