A gunman accused of opening fire inside a northern Mississippi Walmart on Tuesday — leaving two dead and a police officer injured — was shot and taken into police custody, officials said.

Investigators said the incident unfolded Tuesday morning after 6:30 a.m. local time at the chain's store in Southaven, a city roughly 14 miles south of Memphis, Tenn.

BROOKLYN BLOCK PARTY SHOOTING LEAVES 1 DEAD, 11 INJURED

The two people "senselessly murdered" were killed at the Walmart Superstore, DeSoto County Sheriff Chief Deputy Macon Moore said at a news conference Tuesday.

Moore said around 6:33 a.m., the department received calls about an active shooter and a fire set inside the store, where 60 employees were working.

When two responding officers encountered the suspect outside in a parking lot, one of them was shot — but was saved by a bulletproof vest. The chief deputy said the suspect was engaged by the other officer, who struck the suspect twice.

The suspect was taken into custody and transported to a hospital, where the person was undergoing surgery.

CLICK HERE TO GET THE FOX NEWS APP

Moore told reporters on Tuesday that just two weeks ago, the Southaven police and fire departments underwent an active shooter training, and he said "there is no doubt that that training they received two weeks ago saved lives today."

Walmart tweeted the company is "deeply saddened by the reports from our store in Southaven, Mississippi."

"We are working with local law enforcement and will continue to update as we learn more," the statement read. "Our hearts are with the victims, their families and the entire Southaven community."

The chief deputy said as of 11 a.m. local time, officials were still working to clear the Walmart Supercenter. He noted that a "suspicious package" was found in the store during the shooting.