Walmart announced Friday it will phase out sales of electronic cigarettes in all stores, including Sam's Club stores.

The retail giant detailed the plan in an internal memo, which reads in part, "Given the growing federal, state and local regulatory complexity and uncertainty regarding e-cigarettes, we plan to discontinue the sale of electronic nicotine delivery products."

The memo, which Walmart confirmed to NBC News, states that stores will stop selling e-cigarettes after they run out of the existing inventory.

This past summer, Walmart announced it would raise the minimum age to buy tobacco products to 21. It will continue to sell tobacco cigarettes.

One of the nation’s biggest pharmacy chains, Rite Aid, halted sales of e-cigarettes earlier this year, but it too continues to sell traditional tobacco cigarettes.

CVS made headlines five years ago when it stopped all sales of all tobacco products, including regular and electronic cigarettes.

Anti-tobacco groups urged Walmart to follow CVS's lead.

"Walmart has taken a responsible step given the worsening youth e-cigarette epidemic and the growing number of severe lung disease cases associated with e-cigarette use," Matthew Myers, president of the Campaign for Tobacco-Free Kids, said in a statement.

"We urge them to make this policy permanent and to go further by ending sales of all tobacco products, including cigarettes," Myers said.

Truth Initiative, a nonprofit organization that advocates for tobacco cessation, also applauded Walmart's action, but expressed concern that Walmart continues to sell regular cigarettes.

"As the third largest pharmacy in the country, we also encourage Walmart to stop selling ALL forms of tobacco, especially cigarettes, which remain the leading cause of preventable death in the U.S.," Robin Koval, president of the Truth Initiative, said in a statement to NBC News.

The announcement from Walmart comes amid a growing national epidemic of severe respiratory illnesses linked to vaping. Thursday, the Centers for Disease Control and Prevention reported there are 530 confirmed or probable cases in 38 states, plus the U.S. Virgin Islands.

Eight people have died from the illness.

Investigators have been unable to link the cases to any single product or ingredient.

The Trump administration announced plans to ban flavored e-cigarettes a week ago, but it's unclear how or when that ban would take effect.

Health officials in San Francisco, Michigan and New York have already enacted such bans.

Follow NBC HEALTH on Twitter & Facebook.