The attack at a King Soopers market in Boulder ended when police arrested the lone suspect after exchanging gunfire.
Police have not confirmed a motive. The suspect faces 10 counts of murder.
President Joe Biden has hailed a police officer and father of seven who was killed, and has called for Congress to enact stricter gun control measures.
The grocery store is located in a busy shopping plaza in Boulder, a north-central Colorado city about 30 miles (50km) away from the state capital of Denver.