T helper 17 (TH17) cells are key players in multiple sclerosis (MS), and studies in animal models demonstrated that effector TH17 cells that trigger brain autoimmunity originate in the intestine. We validate in humans the crucial role of the intestinal environment in promoting TH17 cell expansion in MS patients. We found that increased frequency of TH17 cells correlates with high disease activity and with specific alterations of the gut mucosa-associated microbiota in MS patients. By using 16S ribosomal RNA sequencing, we analyzed the microbiota isolated from small intestinal tissues and found that MS patients with high disease activity and increased intestinal TH17 cell frequency showed a higher Firmicutes/Bacteroidetes ratio, increased relative abundance of Streptococcus, and decreased Prevotella strains compared to healthy controls and MS patients with no disease activity. We demonstrated that the intestinal TH17 cell frequency is inversely related to the relative abundance of Prevotella strains in the human small intestine. Our data demonstrate that brain autoimmunity is associated with specific microbiota modifications and excessive TH17 cell expansion in the human intestine.