Researchers found that those who used proton pump inhibitor drugs (PPIs) at least once every three months were 44% more likely to develop dementia in later life than those who did not take the drugs.
PPIs are commonly found in heartburn tablets such as omeprazole and lansoprazole. They are often prescribed to treat issues such as acid reflux and stomach ulcers.
The drugs work by blocking the enzyme in the wall of the stomach that produces acid.
Researchers from Germany studied insurance data from 74,000 people aged 75 and over, between 2004 and 2011.
They found that people who used PPIs at least once every three months had a 44% increased risk of developing dementia, compared to those who didn't take the drugs.
The study did have limitations, however, as it only unearthed a "statistical association" between dementia and PPIs, and not a cause-and-effect link.
Co-author of the study, Britta Haenisch, who is from the German Center for Neurodegenerative Diseases in Bonn, said: "To evaluate cause-and-effect relationships between long-term PPI use and possible effects on cognition in the elderly, randomised, prospective clinical trials are needed."
The German researchers, whose findings were published in the journal JAMA Neurology, added that "the avoidance of PPI medication may contribute to the prevention of dementia".
Previous research into PPIs and dementia suggested that people who took the drugs were more likely to be deficient in vitamin B12, which can cause neurological damage.
Dr Helen Webberley, the dedicated GP for Oxford Online Pharmacy, said: "We have known for some time that proton pump inhibitors (PPIs) may have long term health effects, but there is not a well-described causal link with dementia.
"This information is a surprise finding from looking at a lot of data and as such cannot be used to establish a definite cause and effect.
"It does, however, highlight that we are sometimes too willing to pop pills to cure our ills."
She added: "PPIs are a good example of a drug that causes reliance. They are excellent at reducing acid, but when you stop them you get a rebound worsening in acid reflux and indigestion, which makes you want to take them more.
"My advice is to always discuss plans to stop medication with the prescriber, be that your doctor or pharmacist. If you would like to withdraw from PPIs reduce your intake slowly, first by taking them on alternate days and then every three days until your body gets used to the medicine being withdrawn from your system."
Laura Phipps, from Alzheimer’s Research UK, added that the latest study "doesn't tell us definitively that the drugs directly cause the condition".
"There can be many reasons why two factors associate with each other and the next step will be to investigate the possible reasons for this link," she explained.
"Studies like this, which harness large amounts of medical data to highlight trends in health and disease, are incredibly useful to inform future, detailed, follow-up studies into risk factors for conditions like dementia.
"When any drug is taken, doctors, pharmacists and patients have to weigh up the benefits against the potential side effects and further studies into this area will help to better inform these decisions."
At times everyone can become tired of housework, business activities, or social obligations. However a person with dementia may become very passive, sitting in front of the television for hours, sleeping more than usual, or appear to lose interest in hobbies.
A person with dementia may seem different from his or her usual self in ways that are difficult to pinpoint. A person may become suspicious, irritable, depressed, apathetic or anxious and agitated especially in situations where memory problems are causing difficulties.
Everyone can become sad or moody from time to time. A person with dementia may become unusually emotional and experience rapid mood swings for no apparent reason. Alternatively a person with dementia may show less emotion than was usual previously.
Anyone can temporarily misplace his or her wallet or keys. A person with dementia may put things in unusual places such as an iron in the fridge or a wristwatch in the sugar bowl.
A person with dementia may find it difficult to follow a conversation or keep up with paying their bills.
People with dementia may dress inappropriately, wearing several layers of clothes on a warm day or very few on a cold day.
We sometimes forget the day of the week or where we are going but people with dementia can become lost in familiar places such as the road they live in, forget where they are or how they got there, and not know how to get back home. A person with dementia may also confuse night and day.
Occasionally everyone has trouble finding the right word but a person with dementia often forgets simple words or substitutes unusual words, making speech or writing hard to understand.
People with dementia often find it hard to complete everyday tasks that are so familiar we usually do not think about how to do them. A person with dementia may not know in what order to put clothes on or the steps for preparing a meal.
Declining memory, especially short-term memory, is the most common early symptom of dementia. People with ordinary forgetfulness can still remember other facts associated with the thing they have forgotten. For example, they may briefly forget their next-door neighbour's name but they still know the person they are talking to is their next-door neighbour. A person with dementia will not only forget their neighbour's name but also the context.