Armed with a pistol and rifle, classmates say, the shooter appeared "passive" in the hallway of a high school in a tiny Washington state town. He tried to fire a weapon, but it jammed, and another boy confronted him.

"He went to his next weapon," Spokane County Sheriff Ozzie Knezovich said. "A student walked up to him, engaged him, and that student was shot. That student did not survive."

Three other students were seriously injured by gunfire Wednesday morning at Freeman High School south of Spokane. A custodian stopped the shooter, a heroic action the sheriff said prevented more bloodshed. The injured victims were expected to survive.

He called me and said, 'Mom, there are gunshots.' He sounded so scared. -Cheryl Moser, mother of freshman student

The suspect, who a classmate described as being obsessed with previous school shootings, was taken into custody.

Witnesses described a panicked scene when shots rang out, with bullets hitting the ceiling and students screaming and running down the hallway.

'Watched a lot of school shooting documentaries'

A two-lane highway into the town of about 500 people near the Idaho border was clogged as worried parents sped to the school. Some people abandoned their cars on the road shoulder to make it to their children.

Elisa Vigil, a 14-year-old freshman, told The Associated Press that she saw one male student shot in the head who janitors covered with a cloth and another female student wounded in the back.

Michael Harper, a 15-year-old sophomore, said the suspect had brought notes in the beginning of the school year, saying he was going to do "something stupid" and might get killed or jailed. Some students alerted counselors, the teen told AP, but it wasn't clear what school officials did in response.

Ambulances line up in the emergency area of Sacred Heart Hospital following the shooting at Freeman High School. The injured victims were expected to survive. Authorities say the suspect is in custody. (Kathy Plonka/The Spokesman-Review via AP)

A call to the school was not immediately returned.

Harper said the shooter had many friends and was not bullied, calling him "nice and funny and weird" and a huge fan of the TV show "Breaking Bad." He also said the suspect was obsessed with other school shootings.

"He watched a lot of school shooting documentaries," Harper said.

Authorities didn't release the suspect's identity or a possible motive. The victims also were not named.

'Mom, there are gunshots'

Luis Prito, an assistant football coach at Freeman High, called the shooting devastating.

"This is a real close-knit community," he said.

Gov. Jay Inslee said in a statement that "all Washingtonians are thinking of the victims and their families, and are grateful for the service of school staff and first responders working to keep our students safe."

Cheryl Moser said her son, a freshman, called her from a classroom after hearing shots fired.

"He called me and said, `Mom, there are gunshots.' He sounded so scared. I've never heard him like that," Moser told The Spokesman-Review newspaper. "You never think about something happening like this at a small school."

Providence Sacred Heart Medical Center and Children's Hospital received three pediatric patients, spokeswoman Nicole Stewart said. They were in stable condition and surrounded by family, she said.

Stephanie Lutje told AP she was relieved to hear her son was safe after his school near Freeman High was put on lockdown. She commended the school district for its communication.

She still worried for others she knew, including a co-worker who had yet to hear from her son, a sophomore at Freeman.

"My stomach's in knots right now," she said.