HIGHLANDS RANCH, Colorado: A Denver suburb sought answers on Wednesday as to why two students walked into their school and opened fire with handguns, injuring eight people and killing one just a few kilometres from where a school massacre took place 20 years ago.

Two surviving victims of the Tuesday attack at the Science, Technology, Engineering and Math (Stem) School in Highlands Ranch remained in a serious condition, medical officials said.

Another was stable and five had been discharged from hospital.

An 18-year-old male was pronounced dead at the scene, Douglas County Sheriff Tony Spurlock said. He later identified one of the shooters as Devon Erickson, 18.

Spurlock was set to give a news briefing at 6am (0800 ET) on Wednesday and Erickson was expected in Douglas County district court in nearby Castle Rock at 1.30pm (1530 ET).

Erickson, and another suspect identified only as a juvenile, opened fire in two separate classrooms and were arrested within minutes at the public charter school about 40km south of Denver, Spurlock said.

Colorado ABC affiliate Denver 7, citing law enforcement sources, said a combination of factors, including revenge and anger, spurred the attack.

One suspect faced bullying for wanting to change from female to male and identifying as a male, the station said.

Police declined to give a motive on Tuesday.

The shooting occurred less than a month after the 20th anniversary of the Columbine High School massacre in nearby Littleton, about 8km from the Highlands Ranch school.

What happened inside the Stem school remains unclear.

Spurlock said there was a “struggle” as officers entered the building and some students said one victim was shot in the chest as he tried to tackle a shooter.

A man who identified himself as Fernando Montoya said his 17-year-old son, a junior at Stem, was shot three times when a shooter walked into his classroom and opened fire.

“He said a guy pulled a pistol out of a guitar case and started to shoot” Montoya told Denver 7.

The bloodshed shocked the affluent suburb of Highlands Ranch, and parents and students who had considered the school a safe place for its 1,850 pupils ranging from kindergarten to 12th grade.

The attack followed a week after a gunman opened fire on the Charlotte campus of the University of North Carolina, killing two people and wounding four others.