The urethra is considered a passive conduit for urine. Here, we reveal a surprising multicellular signaling pathway guiding the urethra’s dynamic response to an invading pathogen. Using a genetic approach in female mice, we deposited uropathogenic Escherichia coli into the distal urethra to establish a model of ascending urinary tract infection that progresses to the bladder within 4 h. We show that urethral neuroendocrine cells (UNECs), and the serotonin they synthesize, protect the bladder from bacterial colonization. We tested the hypothesis that serotonin initiates urethral contraction to expel ascending bacteria. We identified transient receptor potential cation channel subfamily A member 1, a noncanonical lipopolysaccharide receptor, in human and mouse UNECs and localized the serotonin receptors (HTR) 2B and 3, as well as the calcium-activated chloride channel anoctamin 1 (ANO1) to the pacemaker cells of the human and mouse urethra, the interstitial cells of Cajal (ICCs). HTR2B or ANO1 activation is sufficient for urethral contraction and is required for serotonin-induced mouse urethral contraction. Our results support the hypothesis that the urethra actively surveils its environment and responds to an ascending pathogen by evoking UNECs and ICC to induce urethral contraction and pathogen expulsion.