Colorado shooting
A vehicle leaves the Copper Canyon apartments, where deputies and civilians were shot in Highlands Ranch, Colorado, on 31 December 2017. Reuters

One police officer was killed and several others were injured in an "ambush attack" in Colorado.

A Swat team and a bomb squad arrived at the ranch south of Denver around 5am local time on Sunday (31 December) in response to a verbal disturbance.

The suspect shot at the officers when they entered the Copper Canyon Apartments, firing at least 100 rounds before the gunman, who has not been named, was killed.

Douglas County Sheriff Tony Spurlock confirmed the dead officer was 29-year-old Zackari Parrish, who was married with two children.

"We are deeply saddened by the loss of Zackari. When I sat with his wife and held her hand I could see in her eyes that her life was over," Spurlock said.

Three other deputies and a police officer were also shot along with two civilians who were in a separate apartment to the gunman.

Zackari Parrish
The officer Zackari Parrish, 29, was killed. Douglas County Sheriff's Office

The four injured officers were named as Mike Doyle, Taylor Davis, Jeffrey Pelle and Tom O'Donnell.

Earlier, police had urged locals to stay indoors, tweeting a "code red" and an emergency shelter was set up.

President Donald Trump tweeted: "My deepest condolences to the victims of the terrible shooting in Douglas County @DCSheriff, and their families. We love our police and law enforcement - God Bless them all!"

In 2017, over 15,000 people have been killed by guns in the United States.