Two male students armed with handguns burst into a Denver-area school in the US state of Colorado and opened fire, killing one classmate and wounding eight others before being taken into custody, law enforcement officials said.

Two surviving victims of the attack at the Science,Technology, Engineering and Math (STEM) School in Highlands Ranch, a Denver suburb, remained in serious condition, medical officials said. Others were stable or had been discharged from hospital.

An 18-year-old boy was pronounced dead at the scene, Douglas County Sheriff Tony Spurlock said. 

"Two individuals walked into the STEM school, got deep inside the school, and engaged students in two separate locations," he said.

He said that the suspects, each armed with a handgun, opened fire in two separate classrooms.

They were identified only as two male students of the school, one an adult and the other under age 18.

Sheriff's deputies arrived at the school, located about 40km south of Denver, within two minutes of the first reports, Sheriff Spurlock said, and "engaged the suspects."

Law enforcement officials declined to comment on a possible motive for the shooting, saying it was too early in the course of the investigation, which was being assisted by the Federal Bureau of Investigation.

The school caters for children from kindergarten through to 12th grade (ages 5 to 18).

The White House said President Donald Trump had been briefed on the shooting, which 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.

In 1999, two Columbine students killed 13 people there before taking their own lives in one of the deadliest school shootings in US history.

A man who identified himself as Fernando Montoya said his 17-year-old son was shot three times, and that one of his friends was also wounded.

Mr Montoya said his son told him that one gunman walked into his classroom and opened fire with a gun. One shooter was already in the classroom, the son told his father.

"He said a guy pulled a pistol out of a guitar case and started to shoot," Mr Montoya told local media.

Police officers stand outside the home of one of the alleged gunmen behind the shooting

As the incident unfolded, medical helicopters landed and took off outside the school, while snipers took up position on nearby roofs.

SWAT team officers with rifles secured the area as ambulances and police officers arrived.

Stunned children and high school students could be seen walking down the steps of a building designated as a "reunification" centre.

Colorado Governor Jared Polis said he was sending additional state law enforcement officials to the scene.

"We are making all of our public safety resources available to assist the Douglas County Sheriff's Department in their effort to secure the site and evacuate the students," Mr Polis wrote on Twitter.

Some of the worst mass shootings in the United States have occurred in Colorado.

In addition to Columbine, a man opened fire at a cinema in Aurora, another Denver suburb, in 2012, killing 12 people and injuring scores more.

Yesterday’s shooting came one week to the day after a gunman opened fire on the Charlotte campus of the University of North Carolina, killing two people and wounding four others.

A 22-year-old former student of the university has been charged with murder and attempted murder in that case.