ELKHART, Ind. -- A man fatally shot two women in a northern Indiana grocery store Wednesday night and was lining up to shoot a third person when police officers tracked him down and killed him, authorities said.

Elkhart police received a call about a gunman at Martin’s Super Market about 10 p.m. Wednesday, Indiana State Police Sgt. Trent Smith said Thursday.

The 22-year-old gunman used a semi-automatic handgun to shoot and kill a 20-year-old employee and a 44-year-old shopper, Smith said. The victims’ bodies were found about 12 aisles apart.

Smith said two police officers responding to the scene heard a gunshot as they entered the near-empty store. They dashed to that area and found the shooter pointing his gun at a third person. Smith said the man then aimed his gun at the officers and that’s when they shot him dead.

Smith applauded the officers’ swift response, saying there was no doubt they saved lives.

A large knife was also found near the gunman’s body, he said.

No further details about the victims and gunman have been released, but Smith said there was no indication that the shooter knew the victims. Smith said the man lived in the area.

“At this time, it appears that it’s just random,” he said. He did not elaborate.

The Indiana State Police will investigate the shooting because the Elkhart Police Department was involved in the shooting, Smith said.

“We do have a lot of things to look at as far as video surveillance,” Smith said, noting that state and city police were also interviewing witnesses.

Martin’s Super Market posted a statement on its Facebook page, saying: “Thank you to our community for your thoughts and prayers tonight. We will comment further when we can do so responsibly and appropriately.”

Elkhart is in far northern Indiana, just south of the Indiana-Michigan border, and about 15 miles east of South Bend