Diabetes might actually shrink the brain over a long period of time, reducing the size of crucial areas like the hippocampus, which plays an important role in short- and long-term memory, according to the study.
Additionally, diabetes and high blood pressure both seem to increase a person's risk of micro-strokes and other damage to the blood vessels that feed the brain, the study authors said.
"People who had diabetes earlier in life had much worse brain [structure] than those who had it later in life," said lead author Dr. Rosebud Roberts, a Mayo Clinic researcher. "These scans are showing us that cognitive impairment happens over a long period of time. The earlier you develop type 2 diabetes, the more likely you are to have damage."
Diabetes has long been linked to problems with thinking and memory later in life, but this study is the first to provide solid evidence explaining why that occurs, said Keith Fargo, director of scientific programs and outreach for the Alzheimer's Association.
"We are very excited about this study," Fargo said. "It has been known for quite some time that there is some kind of link between diabetes and cognitive ability later in life. What has not been known yet is why this link exists and how it develops over time."
The study involved more than 1,400 people with an average age of 80, according to the report published online March 19 in the journal Neurology. The study participants had at most slight memory and thinking problems called mild cognitive impairment. The researchers assessed the participants' thinking and memory skills, noting any signs of mild impairment.
The study participants then underwent MRI brain scans to look for signs of brain damage that can be an early indication of dementia.
Finally, the researchers reviewed the participants' medical records to see whether they had been diagnosed with diabetes or high blood pressure in middle age, which, for the purposes of this study, ran from 40 to 64.
The study authors found that people who developed diabetes in middle age had brains that were on average 2.9 percent smaller than people who didn't have diabetes. And their hippocampi were even smaller -- an average of 4 percent smaller than those of non-diabetics.
"When your hippocampus begins to shrink, you begin to lose your long-term memory and your ability to remember recent events," said Roberts, who also is a member of the American Academy of Neurology.
Midlife diabetes also was associated with an 85 percent greater risk of micro-strokes in the brain. Finally, people with middle-age diabetes were twice as likely to have thinking or memory problems, the study found.
And people with high blood pressure in midlife were twice as likely to have damage caused by stroke to portions of the brain associated with thought, memory and language, the researchers said.
Although the study uncovered an apparent link between diabetes or high blood pressure in middle age and memory problems later in life, it didn't prove a cause-and-effect relationship.
The research results emphasize the need for people to adopt a healthy lifestyle in middle age or earlier, Fargo said.
Recent polls show that nearly a quarter of people mistakenly think they're at risk for Alzheimer's disease only if it runs in their family, he said. In reality, dementia can strike anyone if they don't take good care of themselves, he added.
"If you've got a brain, you're at risk for dementia," Fargo said. "Midlife is really going to be a critical time for people to focus on their brain health, and not wait until it's too late."
People who want to protect their brain health should avoid developing diabetes or high blood pressure, Roberts said. She noted that even people who became diabetic in old age still suffered areas of brain damage as a result of the disease.
If a person does develop either chronic condition, they can limit the impact on thinking and memory by controlling the disease with diet, exercise and medication, the researchers said.
"If you have type 2 diabetes, you have an increased risk of brain damage," Roberts said. "But if you control your diabetes well, it should reduce the damage that is being caused in your brain."
To learn more about keeping your brain healthy, visit the Alzheimer's Association.