A group of popular heartburn drugs that includes Nexium, Prevacid, Prilosec, and Protonix may increase your risk of stroke, according to a new study.

The preliminary research, which was presented at the American Heart Association’s Scientific Sessions 2016 in New Orleans in November, stated that the class of drugs known as proton pump inhibitors (PPIs) was found to have increased people’s overall stroke risk by 21 percent.

How do PPIs Work?

PPIs work by blocking the enzyme in the stomach wall that produces acid. By reducing the amount of acid, ulcers are allowed to heal. PPIs are among the most prescribed drugs in the United States and are available in over-the-counter versions. These drugs are most commonly used to treat heartburn, gastric ulcers, and gastroesophageal reflux disease (GERD).

“PPIs have been associated with unhealthy vascular function, including heart attacks, kidney disease and dementia,” said Thomas Sehested, a researcher at the Danish Heart Foundation and the study’s lead author, in a statement. “We wanted to see if PPIs also posed a risk for ischemic stroke, especially given their increasing use in the general population.”

According to the American Stroke Association, ischemic strokes account for 87 percent of all strokes. They occur when a blood vessel supplying blood to the brain becomes blocked.

The Study

Researchers looked at the records of 244,679 Danish patients who underwent an endoscopy to identify the cause of stomach pain and indigestion. The Danish researchers followed up with the patients for nearly six years and found that 9,489 suffered an ischemic stroke for the first time in their lives.

Since PPI users are typically older with more health conditions, the study accounted for age, gender, and medical factors like high blood pressure and heart failure. Still the overall stroke risk increased by 21 percent.

“At one time, PPIs were thought to be safe, without major side effects,” Sehested said, “This study further questions the cardiovascular safety of these drugs.”

Certain PPIs Have Higher Risks of Stroke

The risk of stroke appears to be greatest at higher doses. When taken at the lowest doses, PPIs exhibited no or minimal increased risk of stroke, according to the study.

“People treated with a low dose of PPIs did not have a high risk of stroke,” Sehested said to HealthDay. “Those treated with the highest doses of PPIs had the highest risk of stroke.”

The risk was also dependent on the type of PPI taken.

Researchers looked at four PPIs: omeprazole (Prilosec), pantoprazole (Protonix), lansoprazole (Prevacid) and esomeprazole (Nexium). At the highest doses, the risk of stroke increased by 30 percent for Prevacid and 94 percent for Protonix.

What do the Drug Makers Say?

Since the research is still preliminary, the makers of the drugs have not issued a statement, but some have made comments to the media.

“Patient safety is a top priority … and we continuously monitor the safety of all our medicines and collaborate with regulatory agencies to ensure this information is reflected in the respective prescribing information,” a spokesman for Takeda, the maker of Prevacid, said in an email to CNN.

While the researchers have not said that anyone should stop taking the drug if prescribed, they are encouraging the more cautious use of PPIs.

“We know that from prior studies that a lot of individuals are using PPIs for a much longer time than indicated, which is especially true for elderly patients,” Sehested said.

The prevalence of over-the-counter PPIs makes it more likely that people are exposed to the drug for longer periods of time at unregulated doses.

Are there any Alternatives to PPIs?

An alternative to PPIs is another group of acid reducers called H2 blockers, which includes famotidine (Pepcid) and ranitidine (Zantac). The same Danish study found no increased risk of stroke associated with the drugs but could not say if they would work better for patients than PPIs.

“One thing to keep in mind is, certain products that are in the H2 receptor antagonist class have drug interactions,” pharmacist NaaDede Badger-Plange told CNN. “So, if you have a lot of medications, you probably want to check with your pharmacist at the counter to make sure it’s OK to take those medications.”

You are encouraged to consult a doctor before any changes to your medication, regardless of whether it’s prescribed or bought over the counter.