Just last week, Jaylen Ray Fryberg was smiling and waving to the crowd at Marysville Pilchuck High School's homecoming ceremony. He'd just been crowned freshman homecoming prince. But inside, terrible turmoil was raging.

Law enforcement sources told NBC News that Fryberg was the student who pulled out a small handgun and opened fire on a table full of students in the cafeteria Friday morning at the school in Marysville, about 35 miles north of Seattle. A girl was killed and four other young people were seriously or critically wounded, and Fryberg soon was dead himself of a self-inflicted gunshot wound.

"He seemed like a normal kid," Madison White, 16, a junior, told NBC News. Erick Cervantes, 16, a junior, told NBC News: "He seemed like a nice guy, and he had lots of friends."

Others called Fryberg a happy guy who was popular with his classmates. He was proud of his Native American heritage as a member of the Tulalip Tribes. He was a member of the wrestling and football teams.

But the Jaylen Fryberg who walked into the cafeteria Friday morning was blank-faced and angry, staring down each victim as he pulled the trigger of his .40-caliber Beretta pistol, classmates said. The Snohomish County Sheriff’s Office, which spent Friday night investigating inside the school, said they recovered a .40-caliber handgun.

"He looked very mad" on Friday, Erick said. The sheriff’s office said Saturday morning that investigators interviewed more than 100 witnesses, and determined that a cafeteria worker attempted to stop Fryberg. But everything happened too fast.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

It was all over in four minutes, Marysville police Cmdr. Robb Lamoureux said. The first anonymous call to 911 came in at 10:39 a.m. By 10:41, the school resource officer was on the scene, and by 10:43, it was confirmed that "the shooter was down," Lamoureux said. The wounded were being treated by 10:49 — just 10 minutes after the incident began.

All four of them — two girls and two boys — are under the age of 18 and weren't identified. They were initially taken to Providence Regional Medical Center in Everett, where the 14-year-old girls — later identified as Shaylee Chuckulnaskit and Gia Soriano — were in critical condition with gunshot wounds to the head Friday night. Joanne Roberts, the hospital's chief medical officer, said they remained in "very critical condition" Saturday morning, and that the "next three days are going to be crucial."

A 15-year-old boy, identified as Andrew Fryberg, had surgery for a gunshot wound to the head at Providence and was then taken to Harborview Medical Center in Seattle, where he was in critical condition. The fourth victim, 14-year-old Nate Hatch, was also taken to Harborview, where he was in serious condition with a gunshot wound to the jaw.

Two other students were treated at the school for minor injuries, according to Shari Ireton, director of communications at the Snohomish County Sheriff’s Office. School is canceled next week, and more than 100 people attended a vigil Friday night to comfort one another.

Jaylen Ray Fryberg, the student who opened fire at Marysville Pilchuck High School in Marysville, Washington, on Friday. JAYLEN_RAY_33 VIA INSTAGRAM

Police haven't released any motive in the attack. But classmates said Fryberg had recently gotten into an argument with another student that had racial overtones, and law enforcement sources said he may have been in a recent dispute over a girl.

In posts on Twitter, Fryberg seemed heartbroken over a breakup.

Sometime in mid-June, Fryberg began tweeting often-profane and sexually charged sentiments. Many of the posts appear to express his despair at having lost his girlfriend, whose identity isn't made clear.

"Don't talk to you? ohk! That's what I was doing last night!" he tweeted in mid-June.

"I know it seems like I'm sweating it off. But I'm not."

Fryberg largely stopped tweeting through July and the first half of August. Then he began sending a stream of angry tweets on Aug. 20: "Your not gonna like what happens next!" one read, followed by: "Tell me what your plan is....You can't make a bond with anyone like the bond me and you have right now.... Tell me what your going to do..."

The same day: "I hate that I can't live without you."

On Sept. 18, Fryberg sent another series of angry tweets addressed to a second party who isn't identified. "Did you forget she was my girlfriend?" he begins. Then: "Dude. She tells me everything. And now. I f---ing HATE you! Your no longer my "Brother"!"

Tuesday — less than a week after he'd been all smiles at his homecoming coronation — Fryberg tweeted: "I know it seems like I'm sweating it off. But I'm not. And I never will be able to," and "I should have listened.... You were right... The whole time you were right..."

Early Thursday morning, about a day and a half before the shooting, Fryberg sent this final tweet: