Acid reflux occurs when stomach acid regurgitates, or backs up into, the esophagus, the tube connecting your mouth and stomach. It often happens after eating or when lying down. Most people experience it as ranging from a sour taste in the back of the mouth to a powerful burning sensation in the mid or lower chest and throat.

In some people, acid reflux can become a chronic condition known as gastroesophageal reflux disease (GERD). People with GERD often take proton pump inhibitors (PPIs) — drugs like Prevacid, Prilosec or Nexium. These medications block the site of acid production in certain cells lining the stomach. They are available by prescription and in over-the-counter form.

If you are taking PPIs for GERD, talk to your doctor before you stop taking them.

Studies have found that the use of PPIs increases the risk of bone fractures, chronic kidney disease and stroke. Given that many people take PPIs regularly, a recent study looked at their long-term effects on cognition, specifically the risk of dementia.

Almost 5,700 people participating in the Atherosclerosis Risk in Communities (ARIC) study answered questions about their current and previous PPI use at baseline. The researchers divided the participants into four groups based on how long they had taken PPIs: never took them, took them up to 2.8 years, 2.8 years to 4.4 years and more than 4.4 years. About 1,500 participants reported they had taken PPIs before. The shortest length of PPI use was 112 days and the longest was about 20 years.

What they found was that using PPIs for roughly four and a half years significantly increased a person's risk of dementia.

Participants did not have dementia at baseline, but 585 of them developed the condition during follow-up. Compared to those who were taking PPIs at baseline, those who were not taking PPIs had a similar risk of developing dementia during follow-up. Those who took PPIs for more than 4.4 years prior to follow-up had a 33 percent greater risk of dementia than those who had never taken them. However, those who took PPIs for less than 4.4 years did not have a significantly higher risk of developing dementia.

“More research is needed to confirm our findings and explore the reasons for the possible link between longer-term PPI use and increased dementia risk,” corresponding author, Kamakshi Lakshminarayan, a professor at the University of Minnesota School of Public Health, said in a statement.

If you are taking PPIs for GERD, talk to your doctor before you stop taking them. “Stopping these drugs abruptly may make symptoms worse,” Lakshminarayan cautioned.

The study is published in Neurology.