People with diabetes experience higher rates of long-term cognitive decline, new research suggests.
The study also found that worse control of blood sugar levels, whether someone is diabetic or not, could also lead to a decline in brain function later in life.
The research builds on previous data linking diabetes and cognitive capacity, by establishing a strong connection between overall blood sugar control and a subsequent risk of cognitive decline.
Researchers assessed participants' cognitive function using the English Longitudinal Study of Ageing - a representative database of over-50s in England which stores information about health, wellbeing and economic circumstances in several "waves", or time periods.
Information from the database is used to investigate the ageing process, including life expectancy and health trajectories.
Scientists assessed cognitive function using data from wave two of the database (2004 to 2005), and reassessed every two years until wave seven (2014 to 2015).
Some 5,189 men and women with a mean age of 66 took part. Their baseline levels of glycated haemoglobin (scientifically known as HbA1c) - a measure of blood sugar control - were monitored.
Researchers found that higher levels of glycated haemoglobin were strongly linked to a higher rate of decline in memory, executive function and cognitive function.
Their findings remained statistically significant even when factors such as age, sex, body mass index, alcohol consumption and heart disease were taken into account.
Researchers also discovered that a higher level of HbA1c was directly linked to a higher rate of cognitive decline, whether or not participants were diabetic.
The study was published in diabetes journal Diabetologia and led by scientists at the School of Public Health at Imperial College London and Peking University Clinical Research institute.
Researcher Dr Wuxiang Xie said: "Our study provides evidence to support the association of diabetes with subsequent cognitive decline.
"Moreover, our findings show a linear correlation between circulating HbA1c levels and cognitive decline, regardless of diabetic status.
"Our findings suggest that interventions that delay diabetes onset, as well as management strategies for blood sugar control, might help alleviate the progression of subsequent cognitive decline over the long-term."
He added that future studies were needed to determine long-term effects of maintaining optimal glucose control on cognitive decline in people with diabetes.
Dr Emily Burns, acting head of research communications at Diabetes UK, said: "This study adds to growing evidence linking diabetes and high blood glucose levels to a quicker progression of cognitive decline, which can increase risk of developing dementia in the future.
"We now need to understand if and how diabetes causes this decline, or if these conditions simply share the same biological processes. This will be crucial in finding ways to help people with diabetes keep their brain healthy.
"There are ways you can lower your risk of developing Type 2 diabetes and cognitive impairments, including dementia.
"These include maintaining a healthy weight, enjoying a healthy balanced diet, limiting alcohol intake, avoiding smoking, exercising regularly and keeping your blood pressure in check."