BackgroundTo investigate the incidence of depression in middle-aged and elderly patients with diabetes in China and the influencing factors to provide a theoretical basis to improve the mental health of middle-aged and elderly patients with diabetes and formulate prevention, control, and intervention strategies.MethodsThe sample of this study was obtained from the China Health and Aging Tracking Survey (CHARLS) 2018 survey data, and middle-aged and older patients with diabetes(responding “Yes” to the questionnaire: “Have you ever been told by a doctor that you have diabetes or elevated blood glucose [including abnormal glucose tolerance and elevated fasting glucose]?”) aged ≥ 45 years were selected as study subjects (n = 2,613 ). Depressive symptoms of the study subjects were determined using the simplified version of the Depression Scale for Epidemiological Surveys scores(a score ≥ 10 was defined as depression), influence factors were analyzed using binary logistic regression, and proportion of depressive symptoms was standardized using the sex ratio of the seventh census.ResultsAmong the 2,613 middle-aged and elderly patients with diabetes, 1782 (68.2%) had depressive symptoms and 831 (31.8%) had no depressive symptoms. There were 481 (27.0%) patients aged 45−59 years, 978 (54.9%) aged 60−74 years, and 323 (18.1%) aged ≥ 75 years. The depression rate among middle-aged and elderly Chinese patients with diabetes after standardization correction was 67.5%. Binary logistic regression results showed that age, education level, life satisfaction, marital satisfaction, self-rated health grade, somatic pain, visual impairment, physical disability, and the presence of comorbid chronic diseases were factors that influenced the onset of depression in middle-aged and elderly Chinese patients with diabetes (P < 0.05).ConclusionAccording to a survey analysis of the CHARLS 2018 data, depression is influenced by a combination of factors among middle-aged and elderly patients with diabetes in China. Therefore, for this population, targeted prevention and control should be carried out for key populations, such as middle-aged and elderly people, poor physical health, and low life satisfaction and marital satisfaction, from various dimensions (e.g., demographic and sociological factors, physical health status, and life satisfaction and marital satisfaction).