Epidemiological and experimental evidence suggests that high levels of vitamin D, a potent immunomodulator, may decrease the risk of multiple sclerosis. There are no prospective studies addressing this hypothesis. To examine whether levels of 25-hydroxyvitamin D are associated with risk of multiple sclerosis. Prospective, nested case-control study among more than 7 million US military personnel who have serum samples stored in the Department of Defense Serum Repository. Multiple sclerosis cases were identified through Army and Navy physical disability databases for 1992 through 2004, and diagnoses were confirmed by medical record review. Each case (n = 257) was matched to 2 controls by age, sex, race/ethnicity, and dates of blood collection. Vitamin D status was estimated by averaging 25-hydroxyvitamin D levels of 2 or more serum samples collected before the date of initial multiple sclerosis symptoms. Odds ratios of multiple sclerosis associated with continuous or categorical levels (quantiles or a priori-defined categories) of serum 25-hydroxyvitamin D within each racial/ethnic group. Among whites (148 cases, 296 controls), the risk of multiple sclerosis significantly decreased with increasing levels of 25-hydroxyvitamin D (odds ratio [OR] for a 50-nmol/L increase in 25-hydroxyvitamin D, 0.59; 95% confidence interval, 0.36-0.97). In categorical analyses using the lowest quintile (<63.3 nmol/L) as the reference, the ORs for each subsequent quintile were 0.57, 0.57, 0.74, and 0.38 (P = .02 for trend across quintiles). Only the OR for the highest quintile, corresponding to 25-hydroxyvitamin D levels higher than 99.1 nmol/L, was significantly different from 1.00 (OR, 0.38; 95% confidence interval, 0.19-0.75; P = .006). The inverse relation with multiple sclerosis risk was particularly strong for 25-hydroxyvitamin D levels measured before age 20 years. Among blacks and Hispanics (109 cases, 218 controls), who had lower 25-hydroxyvitamin D levels than whites, no significant associations between vitamin D and multiple sclerosis risk were found. The results of our study suggest that high circulating levels of vitamin D are associated with a lower risk of multiple sclerosis.