Family members appearing on local television confirmed the accounts of students who said that the assailant was a 14-year-old freshman, Jaylen Fryberg, who played football and had been elected a homecoming prince. But the local police commander, Robb Lamoureux, would not give the gunman’s name, identify what type of weapon he used or specify a motive. He would say only that the gunman had “died of a self-inflicted gunshot wound”; an official with the federal Bureau of Alcohol, Tobacco, Firearms and Explosives said the gun had been legally acquired.

Rick Iverson, a former Marysville-Pilchuck English teacher and wrestling coach, said that among the victims was a close friend of Jaylen.

He described Jaylen as “an outgoing person that everyone in the school loved.”

Dr. Joanne Roberts, chief medical officer at Providence Regional Medical Center in Everett, where the four injured students were first taken, said that the wounded students suffered “very serious wounds” and were “critically ill.” The boys, ages 14 and 15, were transferred to Harborview Medical Center in Seattle; one had been shot in the jaw, and the other in the head, she said. The girls, she said, had undergone surgery at Providence for gunshot wounds to the head.

As uninjured students were being evacuated, police officers swept the building to ensure there was no longer an active threat. Students were directed to the nearby Shoultes Gospel Hall to be reunited with their families. The police said they had asked about 30 students and staff members who witnessed the shooting to remain at the school for questioning.

Josh Iukes, a 14-year-old student, said he saw the shooting from inside the cafeteria.

“It seemed like a normal day — he was blank, he wasn’t really saying anything, and then he stood up, pulled something out of his pocket, and shot,” he said. He said the targets were classmates sitting with Jaylen, who were all his friends.