Walgreens said they will stop selling the popular heartburn medicine Zantac and generic versions of the drug after the Food and Drug Administration found traces of a known carcinogen in some of the products.

The move comes on the heels of CVS Health Corp announcing Saturday that it was also pulling Zantac and their own generics from their shelves.

The FDA said earlier this month that small amounts of N-nitrosodimethylamine (NDMA) were found in samples of ranitidine, a drug used to treat and prevent heartburn by reducing stomach acid. The contaminant has also been found in some widely used blood pressure medicines, leading to shortages of those drugs. NDMA has been linked to an increased risk of colorectal and uterine cancers.

"We are removing Zantac and ranitidine products from our shelves while the FDA continues its review of the products," Walgreens spokesperson Phil Caruso told NBC News.

CVS said the move to suspend sales of the over-the-counter heartburn drug was taken out of caution while the FDA continues to review if low levels of NDMA in ranitidine — the active ingredient in Zantac — poses a health risk to patients.

"Zantac brand products and CVS brand ranitidine products have not been recalled, and the FDA is not recommending that patients stop taking ranitidine at this time," CVS said in a statement.

The FDA noted earlier this month that "although NDMA may cause harm in large amounts, the levels the FDA is finding in ranitidine from preliminary tests barely exceed amounts you might expect to find in common foods."

Novartis AG's Sandoz unit said last week it was halting distribution of Zantac in all its markets, including the United States and Canada, following safety review of the drug by U.S. and European drug regulators.

Apotex Corp, which makes generic Zantac for Rite Aid, Walmart and Walgreens, said last week that it was voluntarily recalling its ranitidine products.

Follow NBC HEALTH on Twitter & Facebook.