HIGHLANDS RANCH, Colo. (AP) — Two high school students shot and killed a classmate and injured eight others at a charter school in a Colorado community that just weeks ago marked the 20th anniversary of one of the nation’s worst school shootings.

That Tuesday afternoon’s attack at STEM School Highlands Ranch happened just miles from Columbine High School was sure to raise questions about whether it was inspired by the 1999 massacre, but the answer was not immediately clear.

Douglas County sheriff’s officials said Devon Erickson, 18, and a younger student walked into the STEM School Highlands Ranch through an entrance without metal detectors and opened fire with two handguns on students in two classrooms.

As gunfire echoed through the school, students hid or ran through the halls, some shouting.

“No one really knew what was going on so I didn’t know they were bullets,” said seventh-grader Sophia Marks. “I just kind of saw like flashes and we heard bangs.”

Student Nui Giasolli told NBC’s “Today” show she was in her British Literature class when Erickson came in late.

“He walked to the other side of the classroom where we also had another door and he opened the door. He walked back as if he was going to go back to his seat, then he walked back to the door and he closed it. The next thing I know he’s pulling a gun and he’s telling nobody to move,” she said Wednesday.

Giasolli said another student lunged at the shooter, giving the other students time to dive under the desks and flee to safety.

At least one student encountered the suspects during the shooting, Sheriff Tony Spurlock said. He did not elaborate.

“We’re going to hear about very heroic things that have taken place at the school,” Spurlock said.

He declined to identify the student who was shot and killed at the school.

Within minutes, deputies at a nearby sheriff’s department substation entered the school and arrested the two suspects without exchanging gunfire. One of the suspects was detained by the school’s security guard, Spurlock said.

Both suspects were students at the school and they were not previously known to authorities, Spurlock said.

Josh Dutton, 18, told The Associated Press that he was close friends with Devon Erickson in middle school but hadn’t seen him for four years as he went to a different high school. On Sunday, he spotted Erickson at a local light rail station and said he was shocked at how much his friend had changed.

Erickson wore all black, a hat and sunglasses, was significantly skinnier and didn’t seem interested in talking. “He said he’d just turned 18 and he owned rifles,” Dutton said.

A message left at a phone number listed for Erickson’s home was not immediately returned. He was scheduled to make an initial court appearance Wednesday afternoon.

It was not immediately clear when the younger suspect, who has not been identified, would appear in court.

The shooting took place exactly a week after a gunman killed two students and wounded four at the University of North Carolina-Charlotte. It also comes nearly three weeks after neighboring Littleton marked the grim 20th anniversary of the Columbine school massacre that killed 13 people. The two schools are separated by about 7 miles (11 kilometers) in adjacent communities south of Denver.

“Tragically, this community and those surrounding it know all too well these hateful and horrible acts of violence,” White House spokesman Judd Deere said in a statement. President Donald Trump had been briefed on the shooting and was in touch with state and local officials, Deere said.

“The heart of all Colorado is with the victims and their families,” Gov. Jared Polis said in a statement.

STEM is a public charter school with a focus on science, technology, engineering and math. It has more than 1,850 students in kindergarten through 12th grade.

As the gunfire rang out, students ran through the halls shouting “School shooter!” Some wondered at first if it was a joke or a drill.

Chris Elledge, 15, said his teacher told the class to hide behind weight equipment in the room, where they stayed until police arrived.

“They busted in the room, and they were asking if there was any suspects in the room, if we were OK, and they escorted us out to go out to the front of the building,” Elledge said.

Frantic parents used their cellphones to find their children as news of the shooting spread. Sophia Marks’ mother, Sara Marks, said she has two other children who also go to the school.

“When you have no idea what’s going on and the children are texting you that they’re hiding under a desk and bullets are hitting their window, or things are hitting their window, it’s a horrible feeling,” she said.

Three hospitals reported treating eight people in connection with the attack. Five had been released by Wednesday morning, Spurlock said.

Fernando Montoya told television station KMGH that his 17-year-old son was shot three times but was expected to make a full recovery.

“Thank God he is fine,” Montoya said. “Even though he got shot, he’s OK. He’s going to walk out on his feet, so I’m glad. We’re so lucky.”

AP writer Nicholas Riccardi contributed to this report.