Maternal obesity during pregnancy has been associated with increased risk of neurodevelopmental disorders, including autism spectrum disorder (ASD), in offspring. Here, we report that maternal high-fat diet (MHFD) induces a shift in microbial ecology that negatively impacts offspring social behavior. Social deficits and gut microbiota dysbiosis in MHFD offspring are prevented by co-housing with offspring of mothers on a regular diet (MRD) and transferable to germ-free mice. In addition, social interaction induces synaptic potentiation (LTP) in the ventral tegmental area (VTA) of MRD, but not MHFD offspring. Moreover, MHFD offspring had fewer oxytocin immunoreactive neurons in the hypothalamus. Using metagenomics and precision microbiota reconstitution, we identified a single commensal strain that corrects oxytocin levels, LTP, and social deficits in MHFD offspring. Our findings causally link maternal diet, gut microbial imbalance, VTA plasticity, and behavior and suggest that probiotic treatment may relieve specific behavioral abnormalities associated with neurodevelopmental disorders. VIDEO ABSTRACT.