AimsTo investigate the associations of 25-hydroxyvitamin D (25(OH)D) concentrations, vitamin D intake, magnesium, and calcium with glycemic control in individuals with type 2 diabetes mellitus (T2DM). MethodsA total of 107 adult with T2DM, residing in the state of Sergipe/Brazil (latitude: 10°), were evaluated for serum concentrations of 25(OH)D, parathyroid hormone, fasting glucose, %HbA1c, insulin, C-peptide, total cholesterol and fractions, homeostasis of beta-cell function (HOMA-B), insulin sensitivity (HOMA-S) and resistance (HOMA-IR), anthropometry, body composition, and usual food intake. The results were analyzed according to 25(OH)D status (insufficient/deficient <30 ng/mL; adequate ≥30 ng/mL). Mann–Whitney, chi-square, and binary logistic regression tests were performed. P-value<0.05 was considered significant. ResultsThe median age and time to T2DM diagnosis were 49 and 5 years, respectively. High inadequacy was observed in the dietary intake of vitamin D, magnesium, and calcium. Higher HOMA-B values were observed in the vitamin D adequate group (p = 0.032) and higher fasting serum glucose concentrations (p = 0.012) and %body fat (p = 0.048) in the insufficient/deficient group, which had a higher chance of elevated serum glucose (odds ratio [OR]:2.937; p = 0.020) and HOMA-IR (OR:2.496; p = 0.045). ConclusionVitamin D deficiency is associated with poor glycemic control and insulin resistance, and these aspects are unrelated to inadequate dietary intake of vitamin D, magnesium, and calcium.