Vitamin D exerts multiple immunomodulatory functions and has been implicated in the etiology and treatment of several autoimmune diseases, including multiple sclerosis (MS). We have previously reported that in juvenile/adolescent rats, vitamin D supplementation protects from experimental autoimmune encephalomyelitis (EAE), a model of MS. Here we demonstrate that this protective effect associates with decreased proliferation of CD4+ T cells and lower frequency of pathogenic T helper (Th) 17 cells. Using transcriptome, methylome, and pathway analyses in CD4+ T cells, we show that vitamin D affects multiple signaling and metabolic pathways critical for T-cell activation and differentiation into Th1 and Th17 subsets in vivo. Namely, Jak/Stat, Erk/Mapk, and Pi3K/Akt/mTor signaling pathway genes were down-regulated upon vitamin D supplementation. The protective effect associated with epigenetic mechanisms, such as (i) changed levels of enzymes involved in establishment and maintenance of epigenetic marks, i.e., DNA methylation and histone modifications; (ii) genome-wide reduction of DNA methylation, and (iii) up-regulation of noncoding RNAs, including microRNAs, with concomitant down-regulation of their protein-coding target RNAs involved in T-cell activation and differentiation. We further demonstrate that treatment of myelin-specific T cells with vitamin D reduces frequency of Th1 and Th17 cells, down-regulates genes in key signaling pathways and epigenetic machinery, and impairs their ability to transfer EAE. Finally, orthologs of nearly 50% of candidate MS risk genes and 40% of signature genes of myelin-reactive T cells in MS changed their expression in vivo in EAE upon supplementation, supporting the hypothesis that vitamin D may modulate risk for developing MS.