Democratic presidential candidate Beto O'Rourke is seen at the site of a mass shooting at a Walmart in El Paso, Texas, August 4, 2019.

Democratic presidential contenders praised Walmart's decision to step back from ammunition sales – but said the move was not enough.

Beto O'Rourke, a former congressman from El Paso, Texas, the site of a gun massacre last month, was one of the first 2020 hopefuls to react.

"This is a step in the right direction — and I'm grateful Walmart has taken action — but we can't rely on corporations to stop gun violence," O'Rourke said in a post on Twitter. "We need universal background checks, we need red flag laws, and we need to buy back every single assault weapon."

https://twitter.com/BetoORourke/status/1168945477292830723

The retail giant announced Tuesday that it will discontinue sales of certain calibers of short-barrel rifle ammunition. In a memo distributed to employees, CEO Doug McMillon said that Walmart will also stop selling handguns in Alaska, "marking our complete exit from handguns."

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

The announcement follows two deadly mass shootings over the summer at Walmart stores in two Texas cities, El Paso and Odessa. O'Rourke is from El Paso and represented the city as a congressman.

After the El Paso shooting, which left 22 people dead, O'Rourke temporarily left the campaign trail to remain in the city. The shooting in Odessa took place on Saturday. It killed seven people.

Other presidential candidates also praised Walmart's decision.

In a post on Twitter, Sen. Elizabeth Warren, D-Mass., wrote that it was a "good start — but it's not nearly enough. Walmart can and should do much more. And we need real gun reform, now."

"I applaud the brave Walmart workers who called on the company to stop selling guns. This is a good step, but we still have a gun violence crisis," wrote Sen. Bernie Sanders, a Vermont independent.

https://twitter.com/BernieSanders/status/1168967122141233152?s=20

Sen. Cory Booker, D-N.J., said he was encouraged by the announcement, crediting the company's employees and gun control activists.

"I'm hopeful that this activism proves to politicians that Americans want better standards for gun ownership in this country," Booker wrote in a tweet.

O'Rourke has pledged to implement a mandatory buyback program for certain high-powered firearms if elected. While speaking with reporters in Virginia over the weekend, he was asked about what gun owners who fear that the government will take away their guns should think about the plan.

"So I want to be really clear that that's exactly what we're going to do," O'Rourke said. "Americans who own AR-15s and AK-47s will have to sell them to the government."

In a statement, the National Rifle Association, a gun rights advocacy group, chastised the retailer.

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

Shares of Walmart were up about 0.3% in midday trade Tuesday.