The second-generation antipsychotic olanzapine is effective in reducing psychotic symptoms but can cause extreme weight gain in human patients. We investigated the role of the gut microbiota in this adverse drug effect using a mouse model. First, we used germ-free C57BL/6J mice to demonstrate that gut bacteria are necessary and sufficient for weight gain caused by oral delivery of olanzapine. Second, we surveyed fecal microbiota before, during, and after treatment and found that olanzapine potentiated a shift towards an "obesogenic" bacterial profile. Finally, we demonstrated that olanzapine has antimicrobial activity in vitro against resident enteric bacterial strains. These results collectively provide strong evidence for a mechanism underlying olanzapine-induced weight gain in mouse and a hypothesis for clinical translation in human patients.