Bacterial vaginosis (BV) is a highly prevalent vaginal infection that is associated with adverse pregnancy outcomes. Vitamin D exerts an influence on the immune system and may play a role in BV. The objective of this study was to examine the association between maternal vitamin D status and the prevalence of BV in early pregnancy. Women (n = 469) enrolled in a pregnancy cohort study at <16 wk underwent a pelvic examination and provided a blood sample for determination of serum 25-hydroxyvitamin D [25(OH)D]. BV was diagnosed using Gram-stained vaginal smears interpreted using the method of Nugent. Approximately 41% of women had BV (Nugent score 7-10) and 52% had a serum 25(OH)D concentration <37.5 nmol/L. The mean unadjusted serum 25(OH)D concentration was lower among BV cases (29.5 nmol/L; 95% CI: 27.1, 32.0) compared with women with normal vaginal flora (40.1 nmol/L; 95% CI: 37.0, 43.5; P < 0.001). BV prevalence decreased as vitamin D status improved (P < 0.001). Approximately 57% of the women with a serum 25(OH)D concentration <20 nmol/L had BV compared with 23% of women with a serum 25(OH)D concentration >80 nmol/L. There was a dose-response association between 25(OH)D and the prevalence of BV. The prevalence declined as 25(OH)D increased to 80 nmol/L, then reached a plateau. Compared with a serum 25(OH)D concentration of 75 nmol/L, there were 1.65-fold (95% CI: 1.01, 2.69) and 1.26-fold (1.01, 1.57) increases in the prevalence of BV associated with a serum 25(OH)D concentration of 20 and 50 nmol/L, respectively, after adjustment for race and sexually transmitted diseases. Vitamin D deficiency is associated with BV and may contribute to the strong racial disparity in the prevalence of BV.