Integration of sensory and molecular inputs from the environment shapes animal behavior. A major site of exposure to environmental molecules is the gastrointestinal tract, where dietary components are chemically transformed by the microbiota 1 and gut-derived metabolites are disseminated to all organs, including the brain 2 . In mice, the gut microbiota impacts behavior 3 , modulates neurotransmitter production in the gut and brain 4,5 , and influences brain development and myelination patterns 6,7 . Mechanisms mediating gut-brain interactions remain poorly defined, though broadly involve humoral or neuronal connections. We previously reported that levels of the microbial metabolite 4-ethylphenyl sulfate (4EPS) were elevated in a mouse model of atypical neurodevelopment 8 . Herein, we identified biosynthetic genes from the gut microbiome that mediate conversion of dietary tyrosine to 4-ethylphenol (4EP), and bioengineered gut bacteria to selectively produce 4EPS in mice. 4EPS entered the brain and was associated with changes in region-specific activity and functional connectivity. Gene expression signatures revealed altered oligodendrocyte function in the brain, and 4EPS impaired oligodendrocyte maturation in mice as well as decreased oligodendrocyte-neuron interactions in ex vivo brain cultures. Mice colonized with 4EP-producing bacteria exhibited reduced myelination of neuronal axons. Altered myelination dynamics in the brain have been associated with behavioral outcomes 7,[9][10][11][12][13][14]13,14 . Accordingly, we observed that mice exposed to 4EPS displayed anxiety-like behaviors, and pharmacologic treatments that promote oligodendrocyte differentiation prevented the behavioral effects of 4EPS. These findings reveal that a gut-derived molecule influences complex behaviors in mice via effects on oligodendrocyte function and myelin patterning in the brain.