Stem-like T cells selectively contribute to autoimmunity, but the activities that promote their pathogenicity are incompletely understood. Here, we identify the transcription coregulator OCA-B as a driver of the pathogenic maturation of stem-like CD4+ T cells to promote autoimmune demyelination. Using 2 human multiple sclerosis (MS) datasets, we show that POU2AF1, the gene encoding OCA-B, is elevated in CD4+ T cells from patients with MS. We show that T cell-intrinsic OCA-B loss protects mice from experimental autoimmune encephalomyelitis (EAE) while preserving responses to viral CNS infection. In EAE models driven by antigen re-encounter, OCA-B deletion nearly eliminates CNS infiltration, proinflammatory cytokine production, and clinical disease. OCA-B-expressing CD4+ T cells of mice primed with autoantigen express an encephalitogenic gene program and preferentially confer disease. In a relapsing-remitting EAE model, OCA-B loss protects mice specifically at relapse. During remission, OCA-B promotes the expression of Tcf7, Slamf6, and Sell in proliferating CNS T cell populations. At relapse time points, OCA-B loss results in both the accumulation of an immunomodulatory CD4+ T cell population expressing Ccr9 and Bach2, and loss of proinflammatory gene expression from Th17 cells. These results identify OCA-B as a driver of pathogenic CD4+ T cells.