To explore the mediating effect of self-efficacy in the relationship between glycated haemoglobin (HbA1c) levels and health beliefs in community elderly patients with type 2 diabetes. Patients and Methods: From January to March 2022, convenience sampling was adopted to investigate 200 elderly patients with type 2 diabetes in a community in Yangzhou, China. Data were collected using the Health Beliefs Questionnaire, Self-efficacy for Diabetes, and Medication Compliance Questionnaire. Laboratory parameters included HbA1c, fasting blood glucose, postprandial blood glucose, total cholesterol, triglyceride, high-density-lipoprotein cholesterol, and low-density-lipoprotein cholesterol levels. Correlation, linear regression, and mediation analyses were performed using SPSS 27.0. Results: HbA1c levels were higher in men (women vs men: 6.80% [6.08%, 7.73%] vs.7.30% [6.30%, 9.18%]) and employed (employed vs not employed vs retired: 7.60% [6.90%, 10.45%] vs 5.85% [5.40%, 6.95%] vs 7.10% [6.20%, 8.20%]) and low selfefficacy (low vs high: 13.1% [6.55%, 13.85%] vs 6.8% [6.10%, 7.70%]). HbA1c levels were negatively associated with health beliefs (r = −0.246) and self-efficacy (r = −0.240; p<0.01). Linear regression showed that perceived susceptibility, severity, benefit, and barriers, cues to action, and self-efficacy explained 50% of the variance in HbA1c levels after adjusting for sex and current work status. The mediation effect of self-efficacy was partial between health beliefs and HbA1c levels and accounted for 24.65% of the total effect (p < 0.001). Conclusion: Health beliefs influenced the improvement of self-efficacy in older patients with type 2 diabetes mellitus, which in turn could improve HbA1c control. Self-efficacy plays a partial mediating role between health beliefs and Hba1c levels in elderly patients with type 2 diabetes.