The French drug maker Sanofi said Friday that it was recalling the over-the-counter heartburn drug Zantac in the United States and Canada, a month after the Food and Drug Administration first alerted the public that versions of the drug contained low levels of a cancer-causing contaminant .

Several manufacturers of generic versions of Zantac, called ranitidine, had already recalled their products, and major chains like Walgreens, CVS and Walmart had pulled the products from their shelves. Some countries, including Canada, have also requested a halt in distribution of all ranitidine products.

In a statement, Sanofi said it was investigating the issue. “Sanofi is committed to transparency and will continue to communicate results with health authorities from the ongoing testing, and work with them to make informed decisions based on available data and evidence,” the company said.

The F.D.A. said in September that the contaminant found in samples of Zantac was a type of nitrosamine called N-nitrosodimethylamine, or NDMA, which is believed to be carcinogenic in humans and is found in a variety of products, including cured meats. It is the same contaminant that was found in some versions of valsartan, a blood-pressure drug carrying the brand name Diovan. The discovery of NDMA in valsartan led to several recalls of the commonly prescribed drug.