“Endocannabinoids are host-derived lipid hormones that fundamentally impact gastrointestinal (GI) biology. The use of cannabis and other exocannabinoids as anecdotal treatments for various GI disorders inspired the search for mechanisms by which these compounds mediate their effects, which led to the discovery of the mammalian endocannabinoid system. Dysregulated endocannabinoid signaling was linked to inflammation and the gut microbiota. However, the effects of endocannabinoids on host susceptibility to infection has not been explored. Here, we show that mice with elevated levels of the endocannabinoid 2-arachidonoyl glycerol (2-AG) are protected from enteric infection by Enterobacteriaceae pathogens. 2-AG directly modulates pathogen function by inhibiting virulence programs essential for successful infection. Furthermore, 2-AG antagonizes the bacterial receptor QseC, a histidine kinase encoded within the core Enterobacteriaceae genome that promotes the activation of pathogen-associated type three secretion systems. Taken together, our findings establish that endocannabinoids are directly sensed by bacteria and can modulate bacterial function.”