A 16-year-old shot dead three children and one teacher at Silver Rail Elementary School in Bend, Oregon on Thursday afternoon before being killed by a bystander, police said.

The suspect forced his way into the school by shooting at locked doors around 12:59 p.m. local time, Bend Police Chief Mike Krantz said. The three children killed were aged five, eight and 11. A seven-year-old and a 54-year-old teacher were taken to a hospital in critical condition.

A community member who witnessed the shooting pursued the attacker into the school and shot him dead, police said. Officers arrived three minutes later and confirmed the suspect had been killed.

The first 911 call came from someone reporting that an unknown suspect was shooting into their car with a long gun, according to Bend Police Department spokeswoman Sheila Miller. Photos from the scene show a red truck with bullet holes. Minutes later, dispatch received calls that the attacker had entered the school.

Police did not release the suspect's name or identities of the victims. It remains unclear whether the attacker had any connection to the school.

Silver Rail Elementary serves around 450 children and has more than 40 adult staff members. Schools in Bend closed Friday to allow the community time to grieve.

Steven Cook, the top administrative official of the local school district, said in a statement: "We are stunned and heartbroken by this senseless tragedy. No words can adequately express the grief our community is experiencing."

According to the K-12 School Shooting Database, there were 235 shooting incidents at American schools last year and at least 140 so far this year.