BEND, Oregon — A 16-year-old gunman opened fire on Thursday at Silver Rail Elementary School in Bend, Oregon, killing four people and wounding two others before being fatally shot by an armed member of the community, police said.

Bend Police Chief Mike Krantz said the dead included three children, aged 5, 8 and 11, and one teacher. A 7-year-old student and a 54-year-old teacher were taken to hospital with critical injuries, officials reported.

According to Krantz, emergency responders received a call at 12:59 p.m. PDT from a person in a vehicle who reported being shot at multiple times by someone with a long gun. In the minutes that followed, dozens of calls reported a shooter inside the school. Law enforcement ordered the school into lockdown. Officers arrived at the scene at about 1:02 p.m., and soon after an officer reported the suspect had been shot; police later entered and confirmed the suspect was dead.

Police said the attacker gained access to Silver Rail by firing through locked doors. A community member, described by Governor Tina Kotek as armed, saw the suspect enter and pursued him into the school; Kotek thanked that person for intervening and said the action “heroically intervened to stop further loss of life.”

Krantz noted that Bend police officers had taken a full day of active-shooter training in August. He described the response and the ongoing inquiry as part of a lengthy investigation into the incident.

Silver Rail Elementary serves kindergarten through fifth grade and has about 450 students and 40 staff. Bend is a city of about 100,000 in rural central Oregon near the Deschutes National Forest.

Commenting on the shooting, former congresswoman Gabrielle Giffords, a survivor of an earlier mass shooting, said she was “heartbroken” and urged leaders at all levels to act. The shooting is expected to renew national conversations about gun laws, school safety and whether measures such as arming staff should be considered.

Authorities have not released the identities of the victims, the shooter or the community member who fired on the suspect. Officials said the investigation is ongoing and provided few further details at the initial briefing.