[Like the Science Times page on Facebook. | Sign up for the Science Times newsletter.]

Nitrosamines can cause tumors in the liver and other organs in lab animals, and are believed to be carcinogenic in humans. NDMA can form during manufacturing if the chemical reactions used to make the drug are not carefully controlled and monitored, the F.D.A. has said.

Jeremy Kahn, an agency spokesman, said Friday that the agency is still investigating contamination of the heartburn drugs, and that it is unclear how many companies’ products are affected and how the problem originated. However, he said, “We tested a small number of products for this impurity, and all of the products we’ve tested so far have had NDMA at low levels.”

He said that the levels were not high enough that the agency was recommending recalls so far, noting that low levels of NDMA are also found in other drugs and in food products. The agency first learned that some samples of ranitidine contained the chemical in June, after it tested the product in the wake of the valsartan recalls.

The agency’s announcement came on the same day that an online pharmacy, Valisure, petitioned the F.D.A. to request a recall of all products containing ranitidine, because it said its own tests had revealed high levels of NDMA, above the F.D.A.’s acceptable daily limit. The Valisure petition speculated that the source of the NDMA was the result of the “inherent instability” of the ranitidine molecule, which can degrade under certain conditions, such as when it is digested, to create NDMA.

“Our feeling is that this is extremely troublesome,” said David Light, the chief executive of Valisure, which is based in Connecticut. “We took it off our formulary right away.”

Mr. Kahn said the agency does not yet know whether the NDMA was a result of the instability of the drug, but he did say that the F.D.A. believed the source of the problem was separate from the ones that arose in the valsartan case.

The source of the contaminated valsartan was a Chinese manufacturer, Zhejiang Huahai Pharmaceutical Company. Major Pharmaceuticals, Teva Pharmaceutical Industries and Solco Healthcare, which is owned by Huahai Pharmaceutical, sold it in the United States.