Two men were killed Tuesday in a shooting at a Mississippi Walmart in Southaven, and a suspect described by police as a disgruntled former employee has been charged with two counts of murder.

The suspect, identified as Martez Terrell Abram, 39, was shot when two officers confronted him and they exchanged fire, Southaven Police Chief Macon Moore said at a news conference. The suspect was in surgery at a local hospital.

A police officer was injured and taken to the hospital but is expected to be OK. The officer was hit in his bulletproof vest and not seriously hurt, Moore said.

Both victims were Walmart employees; one was found dead in the store and another dead in the parking lot. Southaven Mayor Darren Musselwhite described the shooter as a worker with a grievance against his employer; DeSoto County Sheriff Bill Rasco said the shooter was an employee until Monday.

One of the victims was Brandon Gales, 38, who worked at Walmart for about 16 years and was recently promoted to department manager. Nicholas Gales, Brando Gales's brother, said Brandon was a father of four.

The second victim was Anthony Brown, a 40-year-old father of two who worked as a store manager. He was from Caledonia, Mississippi.

“It wasn’t an accident,” said Travis Jones, an overnight stocker who was working when he heard shots. “He knew what he was doing when he came in there.”

Jones said he saw the body of a store manager on the floor as workers ran out of the store. “It was an ugly scene,” he said.

Police told reporters the first officers arrived on the scene at 6:36 a.m, just three minutes after initial calls came in. Two officers encountered the suspect outside, which is when the police officer was shot. About 60 employees were inside the store when officers arrived; police also were getting reports of a fire that had been set inside the store.

Just two weeks ago, Southhaven police participated in active shooter response training, which undoubtedly helped them Tuesday morning, Moore said.

The incident rattled the community of Southaven, which is 15 minutes south of Memphis, Tennessee, and home to 55,000 people.

Carlos Odom, 35, typically comes to Walmart to visit his cousin, who works there. Odom was leaving around 6:30 a.m. when he heard more than a dozen shots.

"I just hear gunshots," Odom said. "Pow. Pow. Pow. Pow. Pow."

"When the cops run into Walmart, you hear more gunshots. After that, it stopped."

“The entire Walmart family is heartbroken by the loss of two valued members of our team,” Walmart U.S. President and CEO Greg Foran said in a statement Tuesday afternoon. “We feel tragedies like this personally, and our hearts go out to the families of our two associates and the officer who was injured.

“We’ll continue to focus on assisting law enforcement in their investigation and on supporting our associates."

The Walmart shooting comes just two days after a 19-year-old man opened fired at the Gilroy Garlic Festival about an hour southeast of San Jose in California's Bay Area. Three people died in that shooting: a 6-year-old boy, 13-year-old girl and 25-year-old man. At least a dozen people were injured; the shooter was killed by police who were working the festival.

Shortly after the Gilroy Garlic Festival shooting, California Gov. Gavin Newsom blasted the lack of action from congressional Republicans and President Donald Trump when it comes to gun violence.

"California’s doing its part," Newsom said. "But, Jesus, these guys, the folks in the White House, have been supporting the kind of policies to roll back the work we’re doing in states like ours, to get rid of large-capacity magazines, to address the issues that we’re trying to advance on background checks on ammunition."

Contributing: Natalie Neysa Alund, Memphis Commercial Appeal; The Associated Press