The National Rifle Association slammed retail giant Walmart on Tuesday after the company announced it would end sales of handgun ammunition in its stores.

"The strongest defense of freedom has always been our free market economy. It is shameful to see Walmart to succumb to the pressure of the anti-gun elites," the influential gun rights group wrote in a statement.

"Lines at Walmart will soon be replaced by lines at other retailers who are more supportive of America's fundamental freedoms," the statement said.

Read more: The full memo from Walmart's CEO about pulling back on gun sales

Walmart shares closed about 0.3% higher on Tuesday.

NRA tweet

Earlier Tuesday, Walmart CEO Doug McMillon announced that the company will discontinue sales of certain short-barrel rifle ammunition.

In a memo distributed to employees, McMillon said the company will also discourage customers from openly brandishing firearms in its stores. It will no longer sell handguns in Alaska, the last place the company still sold them.

Walmart's moves follow two mass shootings at the retailer's stores in recent weeks, including one in Odessa, Texas on Saturday that left seven people dead. Twenty-two people were killed during a shooting at a Walmart in El Paso, Texas in early August.

Democratic presidential contenders praised Walmart — as well as the employees and activists who pushed for the change — for Tuesday's action.

"This is an important step by Walmart, but we must go further. If we want to end our gun violence epidemic, we must start by passing universal background checks and banning assault weapons and high-capacity magazines," Joe Biden, the Democratic primary frontrunner, wrote in a post on Twitter.

The NRA has been a powerful force in recent discussions of potential new federal gun regulations. President Donald Trump acknowledged that he spoke to leaders of the group last month, as Democratic lawmakers clamored for new measures that the NRA opposed.

"Serious discussions are taking place between House and Senate leadership on meaningful Background Checks. I have also been speaking to the NRA, and others, so that their very strong views can be fully represented and respected," Trump wrote in an Aug. 9 post on Twitter.