Walmart says it will discontinue the sale of handgun ammunition and also publicly request that customers refrain from openly carrying firearms in stores even where state laws allow it.

The announcement comes just days after a mass shooting claimed seven lives in Odessa, Texas, and follows two other back-to-back shootings last month, one of them at a Walmart store.

The Bentonville, Arkansas-based discounter said on Tuesday it would stop selling short-barrel and handgun ammunition after it ran out of its current inventory. It will also discontinue handgun sales in Alaska, marking its complete exit from handguns and allowing it to focus on hunting rifles and related ammunition only.

“We have a long heritage as a company of serving responsible hunters and sportsmen and women, and we’re going to continue doing so,” according to a memo by Walmart’s CEO, Doug McMillon, that will be circulated to employees on Tuesday afternoon.

Walmart is further requesting that customers refrain from openly carrying firearms at its stores unless they are law enforcement officers. Last month, a gunman entered a Walmart store in El Paso, Texas, and killed 22 people using an AK-style firearm whose sale Walmart already bans. Texas became an open-carry state in 2016, allowing people to openly carry firearms in public.

Walmart’s moves will reduce its market share of ammunition from around 20% to a range of about 6% to 9%, according to Tuesday’s memo. About half of its more than 4,000 US stores sell firearms.

The country’s largest retailer has been facing increasing pressure to change its gun policies by gun control activists, employees and politicians after the El Paso shooting and an unrelated shooting in Dayton, Ohio, that killed nine people. A few days before that, two Walmart workers were killed by another worker at a store in Southaven, Mississippi.

In the aftermath of the El Paso shooting, Walmart ordered workers to remove video game signs and displays that depict violence from stores nationwide. But that fell well short of demands for the retailer to stop selling firearms entirely. Critics have also wanted Walmart to stop supporting politicians backed by the National Rifle Association.

The retailer has long found itself in an awkward spot with its customers and gun enthusiasts. Many of its stores are located in rural areas where hunters depend on Walmart to get their equipment. Walmart is trying to walk a fine line by seeking to embrace its hunting heritage while being a more responsible retailer.

With its new policy on open carry, McMillon noted in his memo that individuals have tried to make a statement by carrying weapons into its stores just to frighten workers and customers. But he added that there are well-intentioned customers acting lawfully who have also inadvertently caused a store to be evacuated and local law enforcement to be called to respond.

He said Walmart will continue to treat “law-abiding customers with respect” and it will have a “non-confrontational approach”.

Walmart says it hopes to use its weight to help other retailers by sharing its best practices such as software that it uses for background checks. And the company, which in 2015 stopped selling assault weapons like the AR rifles used in several mass shootings, urged more debate on the reauthorization of the assault weapons ban. McMillon says Walmart will send letters to the White House and the congressional leadership that calls for action on these “common sense” measures.

“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,” McMillon wrote in his memo. “The status quo is unacceptable.”

The National Rifle Association (NRA) was swift to criticize the retailer’s decision. “It is shameful to see Walmart succumb to the pressure of the anti-gun elites,” it said in a statement on Tuesday.

Over the last 15 years, Walmart had expanded beyond its hunting and fishing roots, carrying items like assault rifles in response to increasing demand. But particularly since 2015, often coinciding with major public mass shootings, the company has made moves to curb the sale of ammunition and guns.

Walmart announced in February 2018 that it would no longer sell firearms and ammunition to people younger than 21 and also removed items resembling assault-style rifles from its website. Those moves were prompted by the mass shooting at a high school in Parkland, Florida, that killed 17 people.

In 2015, Walmart stopped selling semi-automatic weapons like the AR-15-style rifle, the type used in the Dayton shooting. The retailer also does not sell large-capacity magazines, handguns (except in Alaska) or bump stocks, nor the AK-style firearm that was used by the El Paso shooter.

In the mid-1990s, Walmart stopped selling handguns with the exception of Alaska.