A gunman has killed 10 people during a shootout at a grocery market in Colorado in the US.

The incident occurred in the afternoon on Monday when the gunman entered the King Soopers supermarket and began firing indiscriminately on people.

The Boulder police who first saw the shootout on YouTube, tweeted of there being an “active shooter at the King Soopers on Table Mesa” street.

Police again warned people to avoid the area and refrain from broadcasting on social media any strategic information they may notice.

However, a passerby recorded the shootout in the supermarket on his camera, where gunshots can be heard in the background.

The police could be seen arriving at the spot and surrounding the market, while people present ran for their safety as the shootout continued.

The police finally managed to overpower the gunman who was dressed in only shorts.

Boulder police chief Maris Herold said that the suspect in their custody was receiving treatment at the hospital.

Meanwhile, the police officer killed during the shootout has been identified as 51-year-old Eric Talley of the Boulder police department.

“The heroic action of Eric Talley when he responded to the scene… phone calls of shots fired in the area and a phone call about a possible person with a patrol rifle,” a report quoted Maris Herold as saying.

Herold also termed the investigation into the unfortunate incident as complex and would take more than five days to solve.

The police department will not release the names of the other victims until their families have been informed.

President Joe Biden had earlier spoken of recommending tougher legislation to verify the credentials of any person wishing to purchase a firearm.