Uropathogenic Escherichia coli (UPEC) cause urinary tract infections (UTIs) by invading urothelial cells. In response, the host mounts an inflammatory response to expel bacteria. Here, we show that the NF-E2-related factor 2 (NRF2) pathway is activated in response to UPEC-triggered reactive oxygen species (ROS) production. We demonstrate the molecular sequence of events wherein NRF2 activation in urothelial cells reduces ROS production, inflammation, and cell death, promotes UPEC expulsion, and reduces the bacterial load. In contrast, loss of NRF2 leads to increased ROS production, bacterial burden, and inflammation, both in vitro and in vivo. NRF2 promotes UPEC expulsion by regulating transcription of the RAB-GTPase RAB27B. Finally, dimethyl fumarate, a US Food and Administration-approved NRF2 inducer, reduces the inflammatory response, increases RAB27B expression, and lowers bacterial burden in urothelial cells and in a mouse UTI model. Our findings elucidate mechanisms underlying the host response to UPEC and provide a potential strategy to combat UTIs