Kroger followed Walmart in asking customers not to display their firearms in stores located in “open carry” states, becoming the latest big chain to reshape its business around gun reform amid a spate of mass shootings.

The nation’s two biggest grocers also are pushing for tougher background checks, bowing to public pressure that has been building since deadly shootings at Walmart stores in El Paso, Texas, and Southaven, Mississippi, claimed 24 lives and wounded dozens this summer.

"Kroger is respectfully asking that customers no longer openly carry firearms into our stores, other than authorized law enforcement officers," Jessica Adelman, group vice president of corporate affairs, said in a statement to CNBC on Tuesday. "We are also joining those encouraging our elected leaders to pass laws that will strengthen background checks and remove weapons from those who have been found to pose a risk for violence.

The announcement came hours after Walmart’s. But the Bentonville, Arkansas-based retailer went further, saying it would stop selling ammunition for military-style weapons and complete its exit from the handgun business.

The company had been under pressure from gun-control advocacy groups, politicians and its own employees since the two store shootings. Roughly 40 white-collar workers in California walked off the job to protest Walmart’s gun policies last month, and e-commerce workers in Portland, Oregon, and in Brooklyn urged the company to stop selling firearms and organized a Change.org petition, which has since garnered more than 150,000 signatures.

"In a complex situation lacking a simple solution, we are trying to take constructive steps to reduce the risk that events like these will happen again," Walmart's chief executive Doug McMillon said in a memo to employees on Tuesday. "The status quo is unacceptable."

The decision was a blow to gun-rights advocates, some of whom had been showing up at Walmart locations carrying guns on their hips in the hope that the retailer would not shift its policies.

Walmart sells guns in about half of it 4,750 U.S. stores, but stopped selling military-style rifles favored by mass shooters in 2015. But until now, it made up about 20 percent of the ammunition market. Now, that share could fall to as little as 6 percent, the company said. Walmart will continue selling long-barrel deer rifles and shotguns, as well as other firearms and ammunition for hunting and sports shooting,

In the wake of the 2018 school shooting in Parkland, Florida, that killed 17 people, Kroger announced it would stop selling guns to customers younger than 21 at the company's Fred Meyer grocery stores in the Pacific Northwest, then decided to stop selling guns and ammunition altogether. Dick's Sporting Goods also banned sales of assault weapons in its stores after Parkland.