Urinary tract infection (UTI) is one of the most prevalent human bacterial infections. New therapeutic approaches, including vaccination and immunotherapy, are urgently needed to combat the rapid global dissemination of multidrug-resistant uropathogens. Development of therapies is impeded by an incomplete understanding of memory development during UTI. Here, we found that reducing bacterial load early in infection, by reducing the inoculum or with antibiotics after infection, completely abrogated the protective memory response. We observed a mixed T helper (TH) cell polarization, composed of TH1, TH2, and TH17 T cells, among T cells infiltrating the bladder during primary infection. Thus, we hypothesized that reducing antigen load altered TH cell polarization, leading to poor memory. Unexpectedly, however, TH cell polarization was unchanged in these scenarios. Instead, we uncovered a population of tissue-resident memory (TRM) T cells that was significantly reduced in the absence of sufficient antigen. Demonstrating that TRM cells are necessary for immune memory, transfer of lymph node- or spleen-derived infection-experienced T cells to naïve animals did not confer protection against infection. Supporting that TRM cells are sufficient to protect against recurrent UTI, animals depleted of systemic T cells, or treated with FTY720 to block memory lymphocyte migration from lymph nodes to infected tissue, were equally protected compared with unmanipulated mice against a second UTI. Thus, we uncovered an unappreciated key role for TRM cells in the memory response to bacterial infection in the bladder mucosa, providing a target for non-antibiotic-based immunotherapy and/or new vaccine strategies to prevent recurrent UTI.