Some heartburn drugs used by millions of Americans are associated with a higher risk of death, a new study suggests, but people on the drugs should talk with their doctor first before stopping the medicines, experts say.

The drugs, called proton pump inhibitors (PPIs), reduce stomach acid and are available over-the-counter and by prescription. Other recent studies have linked PPIs to a range of potential health risks including kidney disease, stomach infections, heart disease, pneumonia, bone fractures, and dementia. Popular brand-name PPI medications include Prilosec, Nexium, Prevacid and others sold over-the-counter or by prescription.

With so many studies associating PPIs with other health risks, researchers from Washington University School of Medicine in St. Louis wanted to find out if people who took the drugs were at greater risk of dying.

"We started thinking, if this is really true that PPIs are associated with all of these adverse events, does that translate to a higher risk of death, an increased risk of mortality," study author Dr. Ziyad Al-Aly told CBS News.

Get Breaking News Delivered to Your Inbox

The scientists used a large database, combing through medical records from the U.S. Department of Veterans Affairs (which did not reveal the patients' identities) to compare death rates among users of PPIs with people who took H2 blockers, another class of drugs that help reduce stomach acid that can cause conditions such as gastro-esophageal reflux.

They looked at data on 275,933 people who had been prescribed a PPI and 73,355 who'd been prescribed an H2 blocker between October 2006 and September 2008, tracking deaths up to five years.

They found a 25 percent increased risk of death in the patients who took a PPI compared with the people who took H2 blockers — about one extra death for every 500 people taking PPIs for a year.

"The results were very clear. We were startled by this. However we sliced the data, analyzed it, there was always a consistent relationship between PPI use and risk of death," said Al-Aly.

The difference may sound small, but considering millions of people take PPIs, Al-Aly said, "It's a small but significant risk."

The researchers found a "graded" relationship, meaning the longer patients took the medication — for 30 days, 60 days, 90, 120 days, a year and so on — the higher their risk of death.

"That told us this was not a fluke. The relationship is there and more robust the longer that patients took their medications," said Al-Aly.

Dr. Folasade P. May, assistant professor of medicine at the Vatche and Tamar Manoukian Division of Digestive Diseases at UCLA, told CBS News that the study needs to be interpreted with caution since it's an observational study which only shows an association, not a cause-and-effect relationship.

The researchers also did not look at the patients' cause of death, she noted.

"If the group taking PPIs was dying more often, what were they dying of? That was one of the more pressing questions for me. Are they dying of heart disease, losing weight, or dying from a mix of medical problems? The PPI group was older and sicker. I would argue if you follow an older, sicker population, then they're likely to have more deaths anyway," May said.

It's not clear why PPIs are linked to a higher risk for some health conditions, said May, but theories include the possibility that less gastric acid production changes the environment of the stomach and lower bowel and may affect how other drugs a patient may be taking — such as a heart medication — are metabolized.

"It could also affect how we absorb iron and minerals like B-12. They may not be absorbed as well when we change the environment in the stomach," said May.

The findings, published in the journal BMJ Open, do not mean that people taking PPIs should stop their medications, the study author said.

"The answer is absolutely no," Al-Aly stressed, explaining that patients need to talk with their doctors about the risks and benefits.

"Someone with a bleeding ulcer who can be helped by a PPI, if it could save their life, in that case the benefit far outweighs the finite risk," he said.

Some people who are at a higher risk for cancer can also benefit from PPIs, said May.

She said further research on the drugs' possible risks is needed.

If you are self-medicating with an over-the-counter PPI, you should talk with your health care provider about the pros and cons and be sure to follow the label and FDA directions and warning, said Al-Aly.

And he advised, "Over-the-counter drugs should be used for a brief period of time."

Some patients may be able to manage heartburn drug-free by losing weight, cutting out tobacco and changing some eating habits, the experts added.

"Reduce late-night eating two hours before you go to sleep," said May, who also recommends heartburn sufferers elevate the head of their beds slightly.

There's mixed evidence on whether or not cutting out coffee, chocolate and highly acidic juices will ease reflux, but May said if any of those bother you, then try to reduce or steer clear of them.