A California teacher'sbrave conversation with a 16-year-old gunman who had opened fire on his classmates allowed 28 other students to quickly escape what could have been a massacre.

Science teacher Ryan Heber calmly confronted the teenager after he shot and critically wounded a classmate, whom he claimed to authorities had bullied him for more than year at Taft Union High School.

"I don't want to shoot you," the teen gunman told Heber, who convinced the teen gunman to drop his weapon, a high power shotgun.

Responding to calls of shots fired, campus supervisor Kim Lee Fields arrived at the classroom and helped Heber talk the boy into giving up the weapon.

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

One student, who police say the shooter had targeted, was shot. He was airlifted to a hospital and remains in critical, but stable condition, Youngblood said. He is expected to undergo surgery today.

Two other students received minor injuries. One suffered hearing loss and another fell over a table while evacuating. Heber received a wound to his head from a stray pellet, police said.

Police said the teen, whose name has not been made public because he is a minor, began plotting on Wednesday night to kill two students he felt had bullied him.

Authorities believe the suspect found his older brother's gun and brought it into the just before 9 a.m. on Thursday and went to Heber's second-floor classroom where a first period science class with 20 students was taking place.

"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 gunman entered the classroom and shot one of his classmates. Heber immediately began trying to talk him into handing over the gun, and evacuating the other students through the classroom's backdoor.

"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 gunman was found with several rounds of additional ammunition in his pockets.

Within one minute of the shooting, a 911 call was placed and police arrived on the scene. An announcement was made placing the school on lockdown and warning teachers and students that the precautions were "not a drill."

The school had recently announced new safety procedures following last month's deadly shooting at a Newtown, Conn., elementary school in which 20 young children were killed. Six school staffers, including the principal, were killed as they tried to protect the children from gunman Adam Lanza.

The school employs an armed security guard, but he was not on campus Thursday morning.

Youngblood said the student would be charged with attempted murder, but the district attorney would decide if he was to be tried as an adult.

Some 900 students attend Taft Union High School, located in Taft, Calif., a rural community in southern California.