This study aims to investigate the connection between 25-hydroxyvitamin D (25(OH)D) levels and the prognosis of breast cancer with various estrogen receptor (ER) statuses. The summary statistics of 25(OH)D levels was obtained from a GWAS of 441,291 individuals and the information of breast cancer was collected from the Breast Cancer Association Consortium. We analyzed the causal association between 25(OH)D levels and breast cancer prognosis using a number of approaches, including inverse variance weighting (IVW). The heterogeneity test was performed using Cochran Q test. IVW, Mendelian randomization (MR)-Egger, and MR Pleiotropy RESidual Sum and Outlier methods were used for sensitivity analysis. In addition, a multivariate MR adjusted for total triglycerides, total cholesterol, and body mass index was used for further analysis. Two-sample MR results showed that 25(OH)D levels were not associated with prognosis in overall breast cancer (odds ratio [OR] = 0.93, 95% confidence interval [CI] = 0.73-1.19, IVW exam) and estrogen receptor positive (ER+) breast cancers (OR = 1.12, 95% CI = 0.77-1.63, IVW exam) and were protective associated with prognosis in estrogen receptor negative (ER-) breast cancers (OR = 0.55, 95% CI = 0.34-0.87, IVW exam). Sensitivity analysis did not observe the presence of heterogeneity and horizontal pleiotropy. In multivariate MR analysis, after adjusting for total triglycerides, total cholesterol, and body mass index, the correlation between the protective relationship between 25(OH)D levels and the prognosis for ER- breast cancer remained and became increasingly significant (OR = 0.51, 95% CI = 0.31-0.83, P = .007). This study demonstrated a protective relationship between 25(OH)D levels and the prognosis of ER- breast cancer, but there was no connection between 25(OH)D levels and the prognosis of ER+ breast cancer.