Eyewitnesses and law enforcement sources identified the shooter as Jaylen Fryberg, a freshman at Marysville-Pilchuck High School, about 40 miles north of Seattle.
Fryberg, 14, was on the football team and a video from this year's homecoming game showed him named the freshman class homecoming prince.
Marysville police refused to release the name of the shooter publicly, but said he was a student at the school and the gun he used, a 40-caliber handgun, was legally acquired, though it was unclear by whom. The deceased victim was a female.
Two of the victims, 14-year-old Nate Hatch and 15-year-old Andrew Fryberg, are relatives of the shooter, according to Hatch's grandfather and a source within the Tulalip Tribes. Some of its members were involved in the shooting.
"My grandson and the shooter were best friends," said the boy's grandfather, Donald Hatch. "They grew up together and did everything together."
Fryberg underwent surgery for a head wound, said Dr. Joanne Roberts, chief medical officer at Providence Regional Medical Center. He and Hatch, who had less serious injuries, were transferred to another hospital.
Fryberg is listed in critical condition, while Hatch is in serious condition.
The other victims, two young women, remain in critical condition, said Roberts. Their head injuries were so severe they were not immediately identifiable, and officials met with relatives to ask about birthmarks and descriptions of their children's clothing to help make a match.
Two other students were treated for minor injuries at the high school, according to the Snohomish County Sheriff's Office.
A 911 caller reported the shooting at 10:39 a.m. Friday, said Marysville Police Commander Robb Lamoureux. School security officers arrived at the cafeteria two minutes later, then confirmed "the shooter was down."
"They're traumatized -- there's no doubt about it," Lamoureux said of the students. "There's a lot of healing that has to take place in this community."
Brian Patrick, the father of a girl who said she was 10 feet from the gunman, told The Associated Press that Fryberg shot his schoolmates in a calm, methodical way.
"The guy walked into the cafeteria, pulled out a gun and started shooting," he said of his daughter's account. "No arguing, no yelling."
The Snohomish County Sheriff's Office said a cafeteria worker tried stopping the shooter, but didn't detail what happened.
Marysville-Pilchuck High School will be closed all of next week, and the football game that was scheduled for this evening was cancelled after the opposing team offered to take second place, schools Superintendent Becky Berg said.
"We are indeed heartsick," Berg said this evening.
Nathan Heckerdorf, a student at the school, told ABC News that he spoke to the shooting suspect before the first class of the day to see how he was doing because he allegedly got into a fight over racial slurs.
The suspect claimed to be alright, and Heckerdorf thought he seemed normal.
Heckerdorf spoke to ABC News by phone while he was waiting to be evacuated from a classroom that he ran into when he heard gunshots.
"We were told to get away from the windows," Heckerdorf told ABC News of what he and about 25 other students were doing inside the classroom.
He said the school splits lunch into two periods and the people in the cafeteria at the time of the first shooting would have been there because they had the earlier lunch.
He was headed to the cafeteria but ran away when he heard the gunshots. He said that someone pulled the fire alarm immediately afterwards, causing everyone to scatter.
"Everybody's still shaken up," Heckerdorf said. "Some people are crying. But, as of now, it's a pretty calm atmosphere."
Eyewitness Alyx Peitzsch told ABC News affiliate KOMO that she was in the cafeteria when the shooting started and she heard four gunshots.
She estimated that there were perhaps 50 people in the cafeteria but she ran out of the room as soon as she heard the shots.
Peitzsch and many other students ran to a church near the school where her mother picked her up.
Police cleared the school's multiple buildings to ensure that the situation was stable and to look for injured students, Lamoureux said, before transitioning from a dynamic scene to an investigative scene. Several hours after the shooting, several students still were being questioned, he added.
The FBI had a SWAT team involved in the searches, and was supporting local authorities by providing additional victim specialists, who have extensive knowledge and experience in assisting victims, witnesses of crisis situations, and their families, an FBI spokeswoman in Seattle said.
President Obama was briefed on the shooting within hours of the incident.
Get real-time updates as this story unfolds. To start, just "star" this story in ABC News' phone app. Download ABC News for iPhone here or ABC News for Android here. To be notified about our live weekend digital reports, tap here.