Medications like Prilosec and Nexium could give patients a Vitamin B12 deficiency if they’re taken for more than two years, a new study shows.

People taking acid-inhibiting medications, such as Prilosec, Zantac, Pepcid, or Nexium, could be short on Vitamin B12.

According to a new study in the Journal of the American Medical Association, proton pump inhibitors (PPIs) and histamine 2 receptor antagonists (H2RAs) suppress gastric acid production, which can mean that the Vitamin B12 in food is not properly absorbed into the body. Vitamin B12 deficiency is linked to serious health complications, such as anemia, nerve damage, and dementia.

“Vitamin B12 deficiency is relatively common, especially among older adults; it has potentially serious medical complications if undiagnosed,” the authors wrote.

Scientists from Kaiser Permanente in Oakland, Calif. examined data from 25,956 patients with a new Vitamin B12 deficiency diagnosis between January 1997 and June 2011, and 184,199 patients without Vitamin B12 deficiency. They compared the two groups based on exposure to acid-inhibiting medications.

Among those who were newly diagnosed with a Vitamin B12 deficiency, 12 percent had been on PPIs for more than two years and 4.2 percent had been on H2RAs for more than two years; 83.8 percent were not on any of the medications. In the control group, 7.2 percent had been on PPIs for two years or more and 3.2 percent had been on H2RAs for more than two years; 89.6 percent were not taking acid-suppressors.

What Is Gastroesophageal Reflux Disease (GERD)? »

The researchers concluded that those on PPIs and H2RAs ran a higher risk of Vitamin B12 deficiency. And the higher the dose, the greater the risk.

They also discovered that the deficiency was more common in women and younger people. Once people stopped taking the medications, their risk went down.

“We cannot completely exclude residual confounding [factors besides the drugs] as an explanation for these findings, but, at minimum, the use of these medications identifies a population at higher risk of B12 deficiency, independent of additional risk factors,” the authors wrote.

Learn What Role Acid Reflux Plays in How Well Babies Sleep »

While their findings do not indicate that people should stop taking these medications, the researchers encourage physicians to be aware of the findings.

The strength of the association between acid-suppressors and vitamin deficiency increased with the medication dose, but not with the total length of time a person takes the medication, noted Dr. Douglas A. Corley, a research scientist at the Kaiser Permanente Northern California Division of Research.

Knowing that Vitamin B12 deficiency is a possibility, should patients taking acid-suppressors ask for screenings? Talk to your doctor, Corley said.

“These results raise the question of whether patients on long-term acid suppressing medications should be screened at least once for vitamin B12 deficiency,” Corley said, noting that his statements refer to those who’ve been on the medications for more than two years.

The most commonly used PPIs are Prilosec, Prevacid, Nexium, Protonix, and Aciphex. The most popular H2RAs include Zantac, Pepcid, and Tagamet.

Find Out if the Damage from GERD Is Reversible »