Objective: To investigate the expression levels of 25(OH)D-3, Th17, and Treg cells and their related cytokines in the peripheral blood of patients with endometriosis (EMT) and analyze their correlations, and explore the immunopathogenesis of endometriosis. Methods: A case-control study was conducted. Peripheral venous blood was collected from the observation group (40 cases) and the control group (40 cases), and the concentrations of 25(OH)D-3, Th17, Treg, IL-17, IL-6, IL-10, and TGF-beta in serum of the two groups were determined by enzyme-linked immunosorbent assay. Results: Compared with the control group, the levels of 25(OH)D-3, Treg, IL-10, and TGF-beta in the observation group were significantly decreased, while the levels of Th17, IL-17, and IL-6 were significantly increased, and the differences were statistically significant (all P < 0.05), Treg drifted to Th17 cells in peripheral blood; 25(OH)D-3 in the observation group was negatively correlated with Th17, IL-17 and IL-6 (rs =-0.362, rs =-0.514, rs =-0.571, all P < 0.05), and were positively correlated with Treg, IL-10, and TGF-beta (rs = 0.683, rs = 0.433, rs = 0.314, all P < 0.05). The correlation analysis of 25(OH)D-3 and Th17, Treg, and their secreted cytokines in the control group was not statistically significant (all P > 0.05). Conclusion: Vitamin D may be involved in the pathogenesis of EMT by regulating the Th17/Treg immune balance system in EMT patients, and there is a negative correlation between vitamin D and Th17/Treg cell imbalance.