The risk was proportionate to how long and how often these drugs, called proton pump inhibitors (PPIs), were taken. That risk increased anywhere from two to eight times, the study authors said.

Although the relative risk seems high, the absolute risk was small. But it was statistically significant, especially for people infected with Helicobacter pylori, a bacteria linked to stomach cancer, the researchers explained.

"While PPIs are one of the most commonly used medications for treating reflux disease as well as dyspepsia, clinicians should exercise caution when prescribing long-term PPIs, even to patients who have H. pylori eradicated," said lead researcher Dr. Wai Keung Leung. He is a professor of gastroenterology at the University of Hong Kong.

PPIs include commonly used drugs like Prilosec, Nexium and Prevacid.

Eliminating H. pylori lowers the risk of stomach cancer significantly, Leung noted. But even after the bacteria is treated, many people still develop stomach cancer.

However, this study couldn't prove PPIs cause stomach cancer, only that an association exists. PPIs are generally considered safe.

"The advice to PPI users, particularly those with past H. pylori infection, is to be cautious with the prolonged usage of PPIs," Leung said. "Doctors should review the indications and needs of long-term PPIs in these patients."

The small increase in the risk of stomach cancer with PPIs was not enough to prompt one gastrointestinal specialist to abandon their use.

"In my own experience, I have seen medicine evolve. And one thing that I try to keep in mind is, while many studies exist and treatment is evolving, we must tailor treatment on an individual basis," said Dr. Sherif Andrawes. He is director of endoscopy at Staten Island University Hospital in New York City.

Even with this new study, "there are medical situations in which PPI therapy is necessary and the risk of side effects is lesser than the risk of developing bleeding or cancer of another area in the GI [gastro-intestinal] tract," Andrawes said.

For example, he explained, the medications can help suppress stomach acids and guard against esophageal cancer in those with Barrett's esophagus.

But, "I also try to ensure that if a patient comes in for reflux symptoms, that we try work on lifestyle modification and diet first, rather than initiating PPI therapy," Andrawes added.

Stomach cancer is the third leading cause of cancer death in the world, he noted, and earlier studies have found a link between PPIs and stomach cancer. But the role of H. pylori was less clear.

To try to assess the role the bacteria played, Leung and his colleagues compared the use of PPIs with another class of drugs used to lower stomach acid -- histamine H2-receptor antagonists (H2 blockers).

The study followed nearly 63,400 patients treated with a combination of a PPI and two antibiotics to kill H. pylori. The treatment was given over seven days between 2003 and 2012.

The patients were followed for an average of seven years, until the participants either developed stomach cancer, died, or the study ended.

During this time, more than 3,200 people took PPIs for nearly three years, while nearly 22,000 took H2 blockers (Pepcid, Zantac, Tagamet).

In total, 153 people developed stomach cancer after being treated with a PPI and two antibiotics. None of these patients tested positive for H. pylori, but they all had chronic gastritis (inflammation of the stomach lining).

Taking PPIs was linked with more than twice the risk of developing stomach cancer, while taking H2 blockers was not associated with any increased risk, the researchers found.

In addition, people who took PPIs every day had more than four times the risk for stomach cancer, compared with those who used the drug once a week.
And the longer PPIs were used, the greater the risk of developing stomach cancer, the findings showed.

The risk rose five times after more than a year, to more than six times after two or more years, and to more than eight times after three or more years, Leung said.

Recent reports have also linked long-term use of PPIs with pneumonia, heart attack and bone fracture, he added.