The majority of the neurotransmitter serotonin is made in the gut, and studies have suggested that it has major effects on the gut microbiota. Now, Kumar, Russell et al. find that serotonin modulates the virulence of enterohemorrhagic Escherichia coli (EHEC) and Citrobacter rodentium, a mouse model of EHEC infection. Serotonin was found to bind to the histidine sensor kinase CpxA, leading to its dephosphorylation and the activation of the transcription factor CpxR, which regulates the expression of EHEC virulence genes, particularly those within the locus of enterocyte effacement (LEE). Increasing the level of serotonin in the mouse gut decreased LEE expression and reduced C. rodentium loads. By contrast, inhibiting serotonin synthesis enhanced pathogenesis and decreased host survival. As other bacterial pathogens also encode CpxA, it represents a promising broad-spectrum antibiotic target.