(CNN) -- A 12-year-old boy entered his middle school gym, pulled a shotgun out of a bag and opened fire on students waiting for school to start Tuesday, wounding two, authorities in Roswell, New Mexico, said.
A girl, 13, was in stable condition Tuesday night following surgery, authorities said. A boy, 11, was in critical condition after surgery.
The bloodshed rattled students and other citizens of Roswell, a city of just under 50,000 people 200 miles southeast of Albuquerque. Monique Salcido, a Berrendo Middle School student who saw two of her friends get shot, admitted she is "in shock."
"I don't want to go to Berrendo again because of what happened," she told CNN's Piers Morgan. "Because I'm afraid it's going to happen again."
The horror might have been much worse if not for one staff member. "(He) walked right up to him and asked him to put down the firearm," said New Mexico Gov. Susana Martinez.
At a vigil Tuesday evening at the Roswell Convention & Civic Center, Martinez cited the teacher by name, saying, "Mr. Masterson ... was a hero ...who stood there and allowed a gun to be pointed right at him. And to talk down that young boy to drop the gun so that there would be no more young kids hurt."
The Berrendo staff directory on the school district's website lists John Masterson as an eighth-grade social studies teacher.
Another school staff member suffered "very minor injuries" in the shooting and declined medical treatment so he could continue to care for the pupils in the gym, the governor said.
Authorities detained a seventh-grader who is "responsible for this," said State Police Chief Pete Kassetas.
One of the two students shot was identified as Kendal Sanders, a 13-year-old girl, the governor said.
She suffered injuries to her right shoulder and was in stable condition after surgery, Martinez said.
The name of the second injured student was not released. He was injured more severely and was undergoing a second surgery Tuesday night, Martinez said. The student suffered injuries to the side of his face and neck, the governor said.
Searching for a motive
Investigators didn't yet have a motive for the shooting, Kassetas added.
Salcido, who knew the shooter, said he was being bullied.
She was among students gathered in the gym to stay out of the cold weather before classrooms opened, according to the governor.
Salcido said "he was right behind me," carrying what she described as a "case," as she entered the gym.
The middle-schooler said she and her friends were talking only to have their conversation interrupted by gunshots.
It all ended fairly quickly when Salcido said a Berrendo staffer ran "and told him to put the gun down."
"He had his hands up in the air," Salcido said of the shooter, adding that students were then put on lockdown for about two hours in their classrooms as some teachers tended to the wounded students.
A New Mexico state police lieutenant happened to be dropping off his child at the school when the principal saw him as she was locking the door during the shooting, Martinez said. She asked the lieutenant to assist, and he helped secure the scene, she said.
Said Chief Kassetas: "I commend the principal and the people that work at this school for saving many more lives."
State police planned to interview more than 100 students and faculty Tuesday. "We're going to be here for quite some time," the police chief told reporters Tuesday afternoon.
Investigators will examine "social media outlets and the forms of communication that students use," Kassetas said.
The state Department of Public Safety said in a news release that state and local police were called to the school at 8:11 a.m.
State Police public information officer Emmanuel Gutierrez said children were bused from the school after the threat had been "alleviated."
Classes at Berrendo were canceled for Wednesday, when counselors will be made available to the community, officials said.
"Today is the day that no superintendent wants to go through," Roswell Superintendent Tom Burris said. "This couldn't happen. It's unbelievable it could."
CNN's Chuck Johnston, Greg Botelho and Vanessa Juarez contributed to this report.