T-cell function is dependent on store-operated Ca2+ influx that is activated by the stromal interaction molecules (STIM) 1 and 2. We show that mice with T-cell-specific deletion of STIM1 or STIM2 are protected from EAE, a mouse model of multiple sclerosis (MS). While STIM1- and STIM2-deficient T cells could be successfully primed by autoantigen, they failed to produce the proinflammatory cytokines IL-17 and IFN-γ. STIM1-deficient T cells showed reduced expression of IL-23R, required for Th17 cell homeostasis, and had impaired chemokine-dependent T-cell migration caused by a lack of chemokine-induced Ca2+ influx. Autoantigen-specific STIM1- or STIM2-deficient T cells failed to expand and accumulate in the CNS and lymph nodes following adoptive transfer to passively induce EAE, suggesting that autoantigen-specific restimulation or homeostasis of STIM1- and STIM2-deficient T cells are impaired. Combined deletion of both STIM1 and STIM2, previously shown to impair Treg development and function, completely protected mice from EAE. This indicates that, in the absence of Ca2+ influx, autoreactive T cells are severely dysfunctional rendering Treg dispensable for the prevention of CNS inflammation. Our findings demonstrate that both STIM1 and STIM2 are critical for T-cell function and autoimmunity in vivo.