A class of medication used to treat conditions such as depression, incontinence, and gastrointestinal disorders has been associated with an increased risk of getting dementia up to twenty years in the future.

In what's considered to be the largest study to date on the alleged link, researchers are encouraging physicians to seriously consider their options when it comes choices of treatment.

The medical records of more than 300,000 individuals currently over the age of 65 were collected by an international team of researchers, a sample that includes close to 50,000 patients diagnosed with dementia.

More than 27 million prescriptions for some form of anticholinergic medication were found among the records.

On analysing the figures, the researchers found the proportion was skewed towards those with dementia, with 35 percent of those with the condition having been prescribed at least one anticholinergic fifteen to twenty years in the past.

As the doses went up for some of the anticholinergic medications, so did the risks.

By comparison, just 30 percent of those without dementia had a prescription. The numbers might seem close, but the difference is significant enough to warrant concern.

"Anticholinergics, medications that block acetylcholine, a nervous system neurotransmitter, have previously been implicated as a potential cause of cognitive impairment," says pharmacologist Noll L. Campbell from Purdue University in the US.

The neurotransmitter plays a key role in the body's neuromuscular communications, making it a choice target for a variety of conditions that affect everything from bladder control to fine motor skills.

Its diverse responsibilities include other functions in the brain that affect memory, motivation, and focus.

Having so many jobs to do means a medication that beneficially interferes with one of the neurotransmitter's tasks will no doubt have some undesired effect elsewhere.

Clinicians weigh up these pros and cons when providing patients with prescriptions – having solid data like this will help them make even better choices.

"Physicians should review all the anticholinergic medications – including over-the-counter drugs – that patients of all ages are taking and determine safe ways to take individuals off anticholinergic medications in the interest of preserving brain health," advises medical scientist Malaz Boustani from Indiana University.

While being informed on the research is a positive thing that can spark important conversations between patients and their doctor, it's important to consider the evidence in context.

That means not dropping your prescription.

"Further research is needed to understand possible reasons for this link," says clinical psychiatrist Chris Fox from the University of East Anglia.

"In the meantime, I strongly advise patients with any concerns to continue taking their medicines until they have consulted their doctor or pharmacist."

Dementia is a growing concern in our aging society, with diagnoses set to be more than double in countries such as the US by 2050.

In its mildest forms, it robs individuals of memory. At its worst, it contributes to an early death.

While headway is being made on ways to limit risks, diagnose it earlier, and even limit its impact, there is still a lot to learn about how the brain's cognitive functions decline with age.

We can't yet rewind the clock a decade or two for those who currently have dementia, but with evidence like this it's possible to strike the right balance in treatments to limit the risks for others.

This research was published in The BMJ.