The mechanism underlying the progression of relapsing-remitting multiple sclerosis to secondary progressive multiple sclerosis (SPMS), characterized by accumulating fixed disability, is yet to be fully understood. Although alterations in the gut microbiota have recently been highlighted in multiple sclerosis pathogenesis, the mechanism linking the altered gut environment with the remote CNS pathology remains unclear. Here, we analyse human CD4+ memory T cells expressing the gut-homing chemokine receptor CCR9 and found a reduced frequency of CCR9+ memory T cells in the peripheral blood of patients with SPMS relative to healthy controls. The reduction in the proportion of CCR9+ cells among CD4+ memory T cells (%CCR9) in SPMS did not correlate with age, disease duration or expanded disability status scale score, although %CCR9 decreased linearly with age in healthy controls. During the clinical relapse of both, relapsing-remitting multiple sclerosis and neuromyelitis optica, a high proportion of cells expressing the lymphocyte activating 3 gene (LAG3) was detected among CCR9+ memory T cells isolated from the CSF, similar to that observed for mouse regulatory intraepithelial lymphocytes. In healthy individuals, CCR9+ memory T cells expressed higher levels of CCR6, a CNS-homing chemokine receptor, and exhibited a regulatory profile characterized by both the expression of C-MAF and the production of IL-4 and IL-10. However, in CCR9+ memory T cells, the expression of RORγt was specifically upregulated, and the production of IL-17A and IFNγ was high in patients with SPMS, indicating a loss of regulatory function. The evaluation of other cytokines supported the finding that CCR9+ memory T cells acquire a more inflammatory profile in SPMS, reporting similar aspects to CCR9+ memory T cells of the elderly healthy controls. CCR9+ memory T cell frequency decreased in germ-free mice, whereas antibiotic treatment increased their number in specific pathogen-free conditions. Here, we also demonstrate that CCR9+ memory T cells preferentially infiltrate into the inflamed CNS resulting from the initial phase and that they express LAG3 in the late phase in the experimental autoimmune encephalomyelitis mouse model of multiple sclerosis. Antibiotic treatment reduced experimental autoimmune encephalomyelitis symptoms and was accompanied by an increase in CCR9+ memory T cells in the peripheral blood. Antibodies against mucosal vascular addressin cell adhesion molecule 1 (MADCAM1), which is capable of blocking cell migration to the gut, also ameliorated experimental autoimmune encephalomyelitis. Overall, we postulate that the alterations in CCR9+ memory T cells observed, caused by either the gut microbiota changes or ageing, may lead to the development of SPMS.