Microbiota dysbiosis has been linked to major depressive disorder, but the mechanisms whereby the microbiota modulates mood remain poorly understood. The authors tested whether specific changes in the microbiome modulate depressive-like behaviors.Stools from learned helpless, non-learned helpless, and non-shocked mice were analyzed by V4 16S RNA sequencing to identify gut bacteria associated with learned helplessness and to quantify the level of the quorum-sensing molecule autoinducer-2 (AI-2). T cells were analyzed by flow cytometry, and serum amyloid proteins (SAA) were analyzed by quantitative real-time polymerase chain reaction. Fecal transfer approach and administration of oleic acid and AI-2 were used to determine the effects of the microbiome and quorum-sensing molecules on depressive-like behaviors.Mice deficient in segmented filamentous bacteria (SFB) were resilient to the induction of depressive-like behavior, and were resensitized when SFB was reintroduced in the gut. SFB produces the quorum-sensing AI-2 and promotes the production of SAA1 and SAA2 by the host, which increases T helper 17 (Th17) cell production. Th17 cells were required to promote depressive-like behaviors by AI-2, as AI-2 administration did not promote susceptibility to depressive-like behaviors or SAA1 and SAA2 production in Th17-deficient mice after stress. Oleic acid, an AI-2 inhibitor, exhibited antidepressant properties, reducing depressive-like behavior, intestinal SAA1 and SAA2 production, and hippocampal Th17 cell accumulation. Stool samples from 10 people with current depressive symptoms and 10 matched healthy control subjects were analyzed as well. Patients with current major depressive disorder exhibited increased fecal interleukin 17A, SAA, and SFB levels.The study results reveal a novel mechanism by which bacteria alter mood.