A study linked heartburn drugs called proton pump inhibitors — such as Nexium (esomeprazole) and Prilosec (omeprazole) — to increased risk of potentially serious stomach infections.

The study published on Jan. 5 in the British Journal of Clinical Pharmacology followed about 565,000 adults in Tayside, Scotland. Dr. Thomas M. MacDonald and colleagues split patients into two groups: Those who used proton pump inhibitors and H2 receptor agonists — another kind of acid blocker — and a control group. Study authors found those who took one of the acid reflux drugs had higher risk of bacterial infections.

“The results suggest that community prescribed [acid suppression medicines] were associated with increased rates of C. difficile and Campylobacter positive gastroenteritis in both the community and hospital settings,” study authors wrote.

Specifically, people who took the drugs had 1.7 times increased risk of C. difficile and 3.7 times increased risk of Campylobacter. The risk went up for hospitalized patients.

These infections typically cause diarrhea and abdominal pain, but they may also be deadly. About 500,000 Americans had C. diff in 2011, and 29,000 of them died within thirty days, according to the Centers for Disease Control and Prevention. The U.S. Food and Drug Administration previously warned about the link between PPIs and C. difficile.

PPIs are more popular than H2s because they are generally more effective. Americans spend about $14 billion a year on PPIs, which work by signaling cells in the stomach lining to reduce gastric acid production.

Heartburn Drugs Not ‘Benign,’ Experts Say

Because drugs like Nexium, Prilosec and Prevacid are so common, many people assume they are harmless, Dr. F. Paul Buckley, surgical director of the Heartburn and Acid Reflux Center at the Scott & White Clinic in Round Rock, Texas, told HealthDay.

“There’s still a myth that these drugs are benign,” Buckley said. “It’s not true.”

While there is a link between reduced acid production and infections, doctors say the study does not prove that PPIs and H2s are the only cause.

For instance, people who are sick and on prolonged courses of antibiotics typically get C. diff, while eating raw or undercooked poultry may cause Campylobacter infections.

Still, experts agree that patients and their doctors need to assess whether or not PPI treatment is the best course of action. Those with occasional heartburn and acid reflux may control acid production with diet and lifestyle changes.

“And you should be reassessed over time, to see if you really need to continue the medication,” Dr. David Bernstein, a gastroenterologist who was not involved in the study told HealthDay. “The potential problems are with long-term use.”

PPI Link to Heart and Kidney Problems Draws Lawsuits

This study linked H2 blockers to infections, but they do not carry risks linked to PPIs in other studies.

For example, one 2016 study in the Journal of the American Society of Nephrology found long-term PPIs users may be 95 percent more likely to experience kidney failure. In 2015, researchers at the Stanford University School of Medicine found a 16 to 21 percent increase in heart attack incidence among PPI users.

These studies and patient reports led some people who say PPIs caused kidney damage and heart attacks to file lawsuits against drugmakers. So far, the U.S. Panel of Multidistrict Litigation consolidated Nexium cases before U.S. District Judge Dale S. Fischer in California.