Vitamin D deficiency is identified as a risk factor for gestational diabetes mellitus (GDM). Forkhead box class O1 (FoxO1) is closely related to GDM; however, the role of vitamin D deficiency and the underlying pathogenesis of GDM has not been elucidated. Serum vitamin D level was detected using chemiluminescence immunoassay. FOXO1 expression was examined using Real-time polymerase chain reaction (PCR), western blot and immunocytochemistry analysis. Apoptosis of cells was assessed by flow cytometry. Mitochondrial function was assessed via reactive oxygen species (ROS) generation and changes in the mitochondrial membrane potential (ΔΨm). Our study demonstrated that vitamin D levels were significantly lower in 40 GDM patients. The silencing of the vitamin D receptor (VDR) decreased cell survival and increased both FoxO1 mRNA and protein expression. Overexpression of FoxO1 could cause the mitochondrial dysfunction (including production of ROS and decrease of mitochondrial membrane potential (ΔΨm)) and cell apoptosis. However, Overexpression of VDR and vitamin D treatment could induce the cell survival and alleviate the FoxO1-induced cell apoptosis, furthermore, vitamin D treatment or silencing of FoxO1 gene could reverse the ROS-induced cell apoptosis. Therefore, our results support that vitamin D may protect FoxO1-induced pancreatic beta cell apoptosis, which suggests that vitamin D may have beneficial effects in preventing and treating GDM.