Objectives: This study aims to investigate 25-hydroxyvitamin D (25(OH) D) levels in patients with glucose and glycated hemoglobin (HbA1c) defined prediabetes and type 2 diabetes mellitus (T2DM). Patients and methods: Eighty-nine prediabetic patients (44 males, 45 females; mean age 48.9 +/- 6.1 years) with impaired fasting glisemia (IFG) with glucose levels between 100-125 mg/dL (5.55-6.98 mmol/L) and HbA1c levels lower than 6.4% (46 mmol/mol), and 78 type 2 diabetic patients (40 males, 38 females; mean age 50.1 +/- 6.9 years) with HbA1c levels higher than 6.5% (48 mmol/mol) and glucose levels higher than 126 mg/dL (6.99 mmol/L) were included in the study. All patients were kept under strict control and were allowed to use their oral antidiabetics. Serum levels of glucose, insulin, HbA1c and 25(OH) D were measured in all patients. Insulin resistance was calculated by homeostasis model assessment formula. Results: While high density lipoprotein cholesterol (p=0.0001), insulin (p=0.013), insulin resistance (p=0.014), and vitamin D levels (p=0.0001) of T2DM patients were significantly lower compared to the IFG group, their HbA1c levels were higher (p=0.0001). There was a negative correlation between vitamin D and HbA1c (r=-0.327, p=0.006), but a positive correlation between vitamin D and insulin (r=0.215, p=0.006), and vitamin D and HOMA-IR (r=0.236, p=0.002). Glycated hemoglobin levels were significantly higher in the T2DM group than in the IFG group (p=0.0001). In the T2DM group, 25(OH) D levels were lower compared to the IFG group (p<0.0001). 25-hydroxy vitamin D levels were inversely associated with HbA1c levels in the T2DM group (p=0.0001, r=0.215). Conclusion: Vitamin D levels were lower in T2DM group than in IFG group. Our findings indicate that vitamin D supplementation to T2DM patients may improve glycemic control.