The events began around 1700 local time and occurred at four different locations in the cities of Denver and Lakewood, police said at a late-night news conference.
Two women were killed and a man was wounded at the first location in Denver, police said, while another man was also shot.
The gunman then proceeded to nearby Lakewood, where he killed one man and wounded another.
And Lakewood police officers, based on information gathered from the sites of previous attacks, were able to identify the attacker while he was traveling to another location.
“There was another exchange of fire with our officers, and the gunman was killed at the scene,” Lakewood Police spokesman John Romero said.
A Lakewood police officer was shot and wounded during the confrontation, and Romero confirmed that he is “currently in the hospital where he is undergoing surgery.”
The motives of the attacker were not clear while an investigation is underway into the incident.
Gun violence is a widespread problem in the United States, where gun control campaigners say the widespread availability of guns and relatively lax laws on their possession lead to a recurrence of this type of incident.
.