Police: Ten killed including police officer in Colorado mass shooting
Boulder Police chief Maris Herold said that the officer, named as 51-year-old Eric Talley, was one of the first responders at the scene. She called his actions "heroic."
Boulder County District Attorney Michael Dougherty said that the alleged shooter was injured and in custody.
"My heart goes out to Eric Talley's family, his loved ones and his colleagues ... His life was cut far too short," Dougherty said.
"I also want to stress how incredibly sorry I am for all the victims who were killed at King Soopers. These were people going about their day, doing their food shopping and their lives were cut abruptly and tragically short by the shooter, who is now in custody," he added.
Herold said that police began receiving calls about shots fired and a call about a person with a "patrol rifle" at around 2:30 pm (2030 GMT), Talley was one of the first officers at the scene and was "fatally shot."
"This is a very complex investigation that will take no less than five days to complete," Herold said in a press conference.
CNN cited an unnamed senior law enforcement source as saying that the weapon used in the shooting was an AR-15-style rifle.
Police said that the names of the victims would not be released until their families are notified.
The Boulder Police Department tweeted an alert about an "active shooter" at a grocery store at around 2:50 pm (2050GMT).
Police said officers arrived at the scene "within minutes" of receiving a 911 call and entered building "very quickly."
"Today, ten lives were tragically lost, including Boulder Police Officer Eric Talley," Colorado Governor Jared Polis said in a statement.
"And tonight, the families of these victims, our fellow Coloradians, my neighbors, are hearing the devastating news that their loved one who simply woke up and went to work this morning, or who ran out to pick up eggs, won't be coming home."
Colorado has been the scene of a number of mass shootings in recent years, including the 2012 mass shooting at movie theater in Aurora which left 12 dead and 70 wounded. James Holmes received 12 life sentences without parole and an additional 3,318 years in prison.
In 1999, 12 students and one teacher were shot dead at Columbine High School in Littleton. The shooters, Eric Harris and Dylan Klebold, were students at the school. They also injured 21 people before killing themselves.