Image copyright AP Image caption Jaylen Fryberg during a homecoming celebration at Marysville Pilchuck High School this month

A female student has been shot dead and four other students wounded in a school cafeteria by a classmate who then took his own life, police in the US state of Washington have said.

The shooting occurred at Marysville Pilchuck High School near Seattle.

Media playback is unsupported on your device Media caption Peter Bowes: A disturbingly familiar scene

The four wounded students, including two cousins of the gunman, were shot in the head, three of them severely hurt.

Officials said the gunman, identified by local media as Jaylen Fryberg, died at the scene.

Police have not identified the deceased victim nor speculated on any motive.

However, one student told Reuters that Fryberg had been rebuffed by one of the female victims of the shooting, saying: "It was a fight over a girl."

Image copyright AP Image caption The students were evacuated after the shooting

A social posting by Jaylen Fryberg earlier in the week appeared to suggest a romantic split: "It breaks me... It actually does... I know it seems like I'm sweating it off... But I'm not.. And I never will be able to."

Parents of other students told the agency there had also been a dispute following football practice this week and that one of the male victims of the shooting had been involved.

But Fryberg was described as a popular member of both the football and wrestling teams.

Student Jordan Luton told CNN: "He came up from behind and had a gun in his hand and he fired about eight bullets. They were his friends so it wasn't just random.

"Then he turned and looked at me and my girlfriend and kind of gave us a smirk and turned around and then shot more bullets outside."

Image copyright AP Image caption Authorities performed a sweep of classrooms searching for the gunman

Another student told the KING 5 network: "There was just a big group of kids... He was quiet. He was just sitting there. Everyone was talking. All of a sudden I see him stand up, pull something out of his pocket.

"At first I thought it was just someone making a really loud noise with like a bag... until I heard four more after that, and I saw three kids just fall from the table like they were falling to the ground dead."

The two wounded cousins were named locally as Andrew Fryberg, 15, and Nate Hatch, 14. Both are in intensive care.

Federal authorities have confirmed the weapon used in the shooting was purchased legally.

The shooting occurred about 10:40 local time (17:40 GMT), and within about four minutes police confirmed the attacker was "down", said Marysville police Cmdr Robb Lamoureux.

He said the gunman had died from "a self-inflicted gunshot wound".