People diagnosed with type 2 diabetes in middle age showed greater mental decline than people without metabolic problems.

Having diabetes in middle age appears to set the mind on a path toward greater cognitive decline, shaving off the equivalent of five years of brain health. These findings, published in the journal Annals of Internal Medicine, are in line with previous research showing a link between type 2 diabetes and dementia. The results reinforce the need for early lifestyle interventions.

“The lesson is that to have a healthy brain when you’re 70, you need to eat right and exercise when you’re 50,” said the study’s lead author, Elizabeth Selvin, an associate professor of epidemiology at the Johns Hopkins Bloomberg School of Public Health, in a press release. “There is a substantial cognitive decline associated with diabetes, pre-diabetes, and poor glucose control in people with diabetes. We know how to prevent or delay the diabetes associated with this decline.”

Learn More: Type 2 Diabetes Diet Tips »

To learn how much impact diabetes has on brain health, researchers followed nearly 16,000 adults with an average age of 57 for more than 20 years. Thirteen percent of the participants had diabetes at the start of the study. Over the next two decades, researchers measured the volunteers’ cognitive function at three separate visits. They also monitored volunteers’ blood sugar levels using the marker HbA1c, which can be used as an indicator of how well a person’s diabetes is controlled.

In the study, people diagnosed with type 2 diabetes during middle age showed a 19 percent greater decline in mental ability, including speed of thinking and executive function, which includes the ability to plan and to organize information. The researchers estimated that this change would be similar to the mental decline that normally happens between ages 60 and 65. They calculated that diabetes in mid-life ages the brain about five years faster than normal.

Researchers also found smaller decreases in mental ability for people with undiagnosed diabetes and for those with pre-diabetes, or the early stages of diabetes. The diversity of study volunteers allowed the researchers to see that all these changes were similar across racial groups.

This is not the first study to link diabetes to age-related mental decline. Previous research, including a 2012 study in the Internal Medicine Journal, found a connection between diabetes and dementia. However, the current study suggests that brain changes may occur in people with type 2 diabetes even before they have progressed to the point of dementia. Plus, people who have not yet been diagnosed with type 2 diabetes, but are on their way, may be setting the stage for a later loss of brainpower.

Related News: New Study Strengthens Connection Between Diet, Diabetes, and Dementia »

With a rapidly aging population, the scope of potential diabetes complications is far-reaching. About 21 million American adults have been diagnosed with diabetes. In addition, more than one-third of adults in the United States are obese, and obesity is one of the major risk factors for type 2 diabetes.

“If we can do a better job at preventing diabetes and controlling diabetes, we can prevent the progression to dementia for many people,” said Selvin. “Even delaying dementia by a few years could have a huge impact on the population, from quality of life to healthcare costs.”

Be on the Lookout for Risk Factors for Dementia »

While type 2 diabetes can be treated with medication, lifestyle changes remain an important tool for prevention. These include taking steps to eat healthily, exercise regularly, quit smoking, and maintain a healthy weight.

These activities, and others, can not only reduce the risk of developing type 2 diabetes, but also lower the chances of developing other complications related to it, such as heart disease, stroke, high blood pressure, and kidney disease.

“Knowing that the risk for cognitive impairments begins with diabetes and other risk factors in mid-life can be a strong motivator for patients and their doctors to adopt and maintain long-term healthy practices,” said study co-author Dr. Richey Sharrett, an adjunct professor at Johns Hopkins, in a press release.

Read More: What Do You Want to Know About Diabetes? »