In the wake of a rash of mass shootings that have left the country reeling, Walmart will stop selling certain forms of ammunition, ask customers to no longer openly carry guns in their stores, and call on President Donald Trump and other lawmakers to pass background checks legislation.

The nation's largest retailer, which previously stopped selling handguns, will now stop selling handgun ammunition as well. And it will no longer make available the types of bullets that while used in hunting rifles can also be fired by military-style weapons.

Additionally, in the more than two dozen states with open carry laws, Walmart is "respectfully requesting that customers no longer openly carry firearms into our stores and Sam's Clubs ... unless they are authorized law enforcement officers,'' said Dan Bartlett, executive vice president of corporate affairs.

That action follows "multiple cases'' in which people entered their stores with visible weapons, upsetting customers and employees, Bartlett said.

Walmart has been the focus of a campaign by gun control activists and others to pressure it to stop selling guns and take other actions in the wake of a wave of mass shootings, including one at a Walmart in El Paso last month that left 22 people dead.

Read the Walmart memo:CEO Doug McMillon outlines mass shootings' response

What to do after Dorian:After Hurricane Dorian: Your house has flooded. Here's what you should do next.

By asking customers not to openly carry weapons in its stores, Walmart will join other retailers such as Starbucks that have implemented similar policies. Walmart will post signs to inform customers of the change and train employees in the coming weeks.

"We just hope that customers will understand the rationale behind this, that it is not an attempt to question their legal rights,'' Bartlett said. "It's certainly just about the experience we've had in our own stores that have put too many customers, too many associates in a place of extreme discomfort. ... We've had multiple cases of evacuations because of this.''

Following Walmart's announcement, Kroger also asked shoppers to leave guns at home and is encouraging lawmakers to pass laws that will strengthen background checks.

Walmart will also no longer sell handguns in Alaska, the one state where it still allowed such purchases.

Walmart will sell what remains of the handgun ammunition it has offered, along with the .223 caliber and 5.56 caliber ammunition that can be used in military-style weapons. But then it will be focused on guns used by sportsmen. The changes it is making will shrink Walmart's ammunition market share from roughly 20% to between 6% and 9%, Bartlett said. The retailer makes up about 2% of the gun market.

Some gun control advocates praised the steps Walmart announced Tuesday.

“Walmart deserves enormous credit for joining the strong and growing majority of Americans who know that we have too many guns in our country and they are too easy to get,” Igor Volsky, the organization's executive director and founder said in a statement.

However, Volsky added "that work doesn’t end with Walmart’s decision today. As Congress comes back to consider gun violence, Walmart should make it clear that it stands with Americans who are demanding real change.”

In a statement from Walmart CEO Doug McMillon to employees, he said the company is calling for federal lawmakers to improve background checks and to create legislation that would "remove weapons from those who have been determined to pose an imminent danger. ... Today, I’m sending letters to the White House and the congressional leadership that call for action on these common sense measures.''

A Walmart in El Paso, Texas, was the site of one of two mass shootings the weekend of Aug. 3 that together left 31 people dead and dozens more injured.

Days earlier, two Walmart managers were killed by a gunman described as a disgruntled employee in a store in Southaven, Mississippi. And other recent mass shootings, including one Saturday near Odessa and Midland, Texas, that left seven dead and 21 injured have left the country shaken and questioning what can be done to stem such violence.

Walmart had previously ended sales of modern sporting rifles, imposed stricter requirements for overall gun sales and began prohibiting sales of firearms to anyone under 21 last year.

But given its major role in the retail sector, activists and lawmakers have demanded Walmart do more. Following the mass shootings that have occurred this summer, tens of thousands signed a petition on Change.org calling on the retailer to stop selling guns.

And a coalition that included Guns Down America, MoveOn, and the American Federation of Teachers planned rallies and launched a #Walmartmustact challenge to encourage the public to deliver letters asking the store chain to stop supporting NRA-backed politicians and support gun buybacks, in addition to halting gun sales.

In a statement Tuesday, the National Rifle Association said it was “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," the NRA’s statement said. “The truth is Walmart’s actions today will not make us any safer.”

Contributing: Kelly Tyko