A cafeteria worker attempted to stop a high school "homecoming prince" after he opened fire inside his Washington state high school's cafeteria on Friday, killing a girl and injuring four other people, including two of his relatives, before shooting himself, police and witnesses said. The motive for the shooting remains unclear, although a series of tweets posted by the gunman points to the cause being a rocky romance, according to Reuters.

Jaylen Fryberg, a freshman at Marysville Pilchuck High School, about 40 miles north of Seattle, was identified as the shooter after an on-scene investigation of the shooting had been conducted by the Snohomish County Sheriff's Office, law enforcement sources confirmed.

However, details were not provided on how the cafeteria worker had tried to stop the 14-year-old gunman, the Sheriff's Office said. A legally acquired .40 caliber Beretta handgun was found at the scene of Friday's shooting, according to Marysville police.

"Just all of a sudden, I see him stand up, pull something out of his pocket," Austin Taylor, who had just finished eating lunch at the next table at the time, told NBC station KING of Seattle. "I saw three kids just fall from the table like they were falling to the ground dead."

"He had a blank stare," Taylor said. "He was just staring at the victims as he shot."

"He was just calm during the whole thing, and he was perfectly fine the day before. Everyone knew him. ... He was always a very nice kid."

Another student, Alan Perez, said he also saw Fryberg pull out his weapon. "I just dropped my skateboard and ran as fast as I could," told KING. "I saw he had a little gun in his hand and saw the flash from the muzzle of the gun."

During the attack, a woman tried to intervene by grabbing Fryberg's arm, junior student Erick Cervantes told NBC News, but as the gunman tried to fire at her, he somehow ended up shooting himself in the neck.

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, who added that Fryberg was in critical condition after having undergone surgery for a head wound while Hatch was in serious condition at Providence Regional Medical Center in Everett.

"My grandson and the shooter were best friends," said the boy's grandfather, Donald Hatch. "They grew up together and did everything together."

The other victims, two young women, remain in critical condition, said Dr. Joanne Roberts, chief medical officer at Providence Regional Medical Center. "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," according to ABC News.

Two other students were treated for minor injuries at the high school, according to the Sheriff's Office.

After the shooting, someone pulled the fire alarm, and students rushed out of classrooms, only to be ushered back in by staff as the building was placed on lockdown.

The gunman was shot down within four minutes of the initial anonymous call to 911, Marysville Police Commander Robb Lamoureux said.

Classmates described Fryberg as popular, and just last week, he was crowned homecoming prince at a football game. But the shooter's tweets seemed to show signs of distress regarding a romantic relationship.

Meanwhile, Marysville-Pilchuck High School will be closed all of next week, said superintendent Becky Berg.

"We are indeed heartsick," Berg said Friday.

The students are "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."