Walmart is to stop sales of some types of ammunition following recent shootings, including one at one of its stores in Texas that left 22 dead.
The head of the company said it would discontinue sales of some bullets that can be used in assault-style weapons, and those used in handguns.
The move comes amid increasing pressure on the company, often cited as the largest firearms seller in the US.
Chief executive Doug McMillon said the company had been "listening".
"It's clear to us that the status quo is unacceptable," he said in a note to employees and published on the firm's website.
The firm also said it would discontinue handgun sales in Alaska, the only place it still offered such weapons.
The firm asked customers at Walmart and its Sam's Club stores to stop carrying firearms openly, even in states where it is legally permitted, saying such actions have caused fear and evacuations.
Mr McMillon said: "We know these decisions will inconvenience some of our customers, and we hope they will understand."
We’ve been working to understand the many important issues arising from the horrific events in El Paso and Southaven, as well as those raised in the national discussion around gun violence. Today, we’re sharing some next steps: https://t.co/chWzGf6Amv pic.twitter.com/Ye3xjjRdrh— Walmart Inc. (@WalmartInc) September 3, 2019
Celebrities and politicians, including several Democrats campaigning for president, praised the firm's decision.
But America's gun lobby, the National Rifle Association, called the changes "shameful" and said the firm would lose business.
"It is shameful to see @Walmart succumb to the pressure of the anti-gun elites. Lines at Walmart will soon be replaced by lines at other retailers who are more supportive of America’s fundamental freedoms."— NRA (@NRA) September 3, 2019
Read @NRA's statement on Walmart's decision here: pic.twitter.com/bmwAS9o0KP
Another major US retailer joined Walmart on Tuesday. Kroger changed its policy by "respectfully asking" customers to stop openly carrying guns in stores where state laws allow it.
Jessica Adelman, group vice-president of corporate affairs, said in a statement that only authorised law enforcement officers should be carrying weapons in Kroger outlets.
Walmart's chief executive, who also called on the US Congress to pass stricter gun laws, said he expected the changes to reduce the firm's share of the ammunition market from about 20% to a range of 6% to 9%.
The company will continue to sell hunting rifles and shotguns, and much of the ammunition for those weapons, he added.
Walmart stock was little changed after the announcement. Shares in some gun-makers, such as Vista Outdoors, slumped.
Guns and ammunition represent a tiny fraction of overall Walmart sales, said Burt Flickinger III, a managing director of the retail consulting firm Strategic Resource Group.
He predicted the decision would pay off, allowing the retailer to provide more store space to faster growing categories such as nappies for babies.
"Walmart will be significantly ahead in sales growth and significantly ahead in profitable sales and market share growth by concentrating on children and health categories, rather than the declining guns and ammo categories," he said.
Walmart's competitive prices will be likely to help it retain customers, no matter what their politics, he added.
Mass shootings in the US
Walmart's decision follows two incidents at stores in August, in which a gunman killed 22 people in El Paso, Texas, and a former employee killed two workers at a Walmart store in Mississippi.
Last month, other mass shootings - defined since 2012 as incidents as those that kill at least three people - in Ohio and Texas left more than a dozen dead.
There have been more than 110 mass shootings in the US since 1982, according to investigative magazine Mother Jones.
However, Walmart has lagged behind other US retailers in changes to its gun policies.
Kroger-owned Fred Meyer stopped selling guns in 2018 after a mass shooting at a school in Parkland, Florida. That same year, Dick's Sporting Goods ended the sale of assault weapons and raised the minimum age to 21 for gun purchases.
Mr Flickinger said the move reflected a shift since Walmart stopped being a family-run company. Sam Walton, who founded the company in 1962, was a known hunting enthusiast.
"It shows a very constructive change from a family-managed and run business," Mr Flickinger said.