The suspect, named by police as Caleb Sharpe and 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.

Caleb Sharpe, 15, has been named as the suspect of the Freeman High School shooting in Washington state. Picture: InstagramSource:Supplied

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 student, 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 student, 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 counsellors, the teen told AP, but it wasn’t clear what school officials did in response. A call to the school was not immediately returned.

Michael 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,” Michael said. Authorities didn’t release the suspect’s identity or a possible motive. The victims also were not named.

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

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

Governor 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 student, called her from a classroom after hearing shots fired.

“He called me and said, ‘Mum, there are gunshots.’ He sounded so scared. I’ve never heard him like that,” Ms Moser told The Spokesman-Review newspaper. “You never think about something happening like this at a small school.”

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

Freeman High School is located in the US state of Washington. Picture: GoogleSource:Supplied