Prodiginines are a class of red-pigmented natural products with immunosuppressant, anticancer, and antimalarial activities. Recent studies on prodiginine biosynthesis in Streptomyces coelicolor have elucidated the function of many enzymes within the pathway. However, the function of RedJ, which was predicted to be an editing thioesterase based on sequence similarity, is unknown. We report here the genetic, biochemical, and structural characterization of the redJ gene product. Deletion of redJ in S. coelicolor leads to a 75% decrease in prodiginine production, demonstrating its importance for prodiginine biosynthesis. RedJ exhibits thioesterase activity with selectivity for substrates having long acyl chains and lacking a β-carboxyl substituent. The thioesterase has 1000-fold greater catalytic efficiency with substrates linked to an acyl carrier protein (ACP) than with the corresponding CoA thioester substrates. Also, RedJ strongly discriminates against the streptomycete ACP of fatty acid biosynthesis in preference to RedQ, an ACP of the prodiginine pathway. The 2.12Å resolution crystal structure of RedJ provides insights into the molecular basis for the observed substrate selectivity. A hydrophobic pocket in the active site chamber is positioned to bind long acyl chains, as suggested by a long-chain ligand from the crystallization solution bound in this pocket. The accessibility of the active site is controlled by the position of a highly flexible entrance flap. These data combined with previous studies of prodiginine biosynthesis in S. coelicolor support a novel role for RedJ in facilitating transfer of a dodecanoyl chain from one acyl carrier protein to another en route to the key biosynthetic intermediate 2-undecylpyrrole.