Background Although important achievements have been done in type 2 diabetes mellitus (T2D) treatment and glycemic control, new strategies may take advantage of non-pharmacological approaches and of other potential determinants of health (e.g., socioeconomic status, education, diabetes knowledge, physical activity, and self-care behavior). However, the relationships between these factors are not totally clear and have not been studied in the context of large urban settings. This study aimed to explore the relationship between these determinants of glycemic control (GC) in a low-income urban population from Mexico City, focused in exploring potential the mediation of self-care behaviors in the association between diabetes knowledge and GC.Methods A multicenter cross-sectional study was conducted in patients with type 2 diabetes (T2D) from 28 primary care outpatient centers located in Mexico City. Using multivariable-adjusted models, we determined the associations between diabetes knowledge, self-care behaviors, and GC. The mediation analyses to determine the pathways on glycemic control were done using linear regression models, where the significance of indirect effects was calculated with bootstrapping.Results The population (N=513) had a mean age of 53.8 years (standard deviation: 11.3 yrs.), and 65.9% were women. Both socioeconomic status and level of education were directly associated with diabetes knowledge. Using multivariable-adjusted linear models, we found that diabetes knowledge was associated with GC (β: -0.102, 95% Confidence Interval [95% CI] -0.189, -0.014). Diabetes knowledge was also independently associated with self-care behavior (for physical activity: β: 0.181, 95% CI 0.088, 0.273), and self-care behavior was associated with GC (for physical activity: β: -0.112, 95% CI -0.194, -0.029). The association between diabetes knowledge and GC was not observed after adjustment for self-care behaviors, especially physical activity (β: -0.084, 95% CI -0.182, 0.014, p-value: 0.062). Finally, the mediation models showed that the effect of diabetes knowledge on GC was 17% independently mediated by physical activity (p-value: 0.049). Conclusions Socioeconomic and educational gradients influence diabetes knowledge among primary care patients with type 2 diabetes. Self-care activities, particularly physical activity, mediated the effect of diabetes knowledge on GC. Our results indicate that diabetes knowledge should be reinforced in low-income T2D patients, with an emphasis on the benefits physical activity has on improving GC.