Clinical isolates of Yersinia, Klebsiella, and Escherichia coli frequently secrete the small molecule metallophore yersiniabactin (Ybt), which passivates and scavenges transition metals during human infections. YbtT is encoded within the Ybt biosynthetic operon and is critical for full Ybt production in bacteria. However, its biosynthetic function has been unclear because it is not essential for Ybt production by the in vitro reconstituted nonribosomal peptide synthetase/polyketide synthase (NRPS/ PKS) pathway. Here, we report the structural and biochemical characterization of YbtT. YbtT structures at 1.4 -1.9 Å resolution possess a serine hydrolase catalytic triad and an associated substrate chamber with features similar to those previously reported for low-specificity type II thioesterases (TEIIs). We found that YbtT interacts with the two major Ybt biosynthetic proteins,HMWP1(high-molecular-weight protein 1) and HMWP2 (high-molecular-weight protein 2), and hydrolyzes a variety of aromatic and acyl groups from their phosphopantetheinylated carrier protein domains. In vivo YbtT titration in uropathogenic E. coli revealed a distinct optimum for Ybt production consistent with a tradeoff between clearing both stalled inhibitory intermediates and productive Ybt precursors from HMWP1 and HMWP2. These results are consistent with a model in which YbtT maintains cellular Ybt biosynthesis by removing nonproductive, inhibitory thioesters that form aberrantly at multiple sites on HMWP1 and HMWP2.