While several bioactive natural products that contain tetramate or pyridone heterocycles have been described, information on the enzymology underpinning these functionalities has been limited. Here we biochemically characterize an off-loading Dieckmann cyclase, NcmC, that installs the tetramate headgroup in nocamycin, a hybrid polyketide/nonribosomal peptide natural product. Crystal structures of the enzyme (1.6 A) and its covalent complex with the epoxide cerulenin (1.6 A) guide additional structure-based mutagenesis and product-profile analyses. Our results offer mechanistic insights into how the conserved thioesterase-like scaffold has been adapted to perform a new chemical reaction, namely, heterocyclization. Additional bioinformatics combined with docking and modeling identifies likely candidates for heterocycle formation in underexplored gene clusters and uncovers a modular basis of substrate recognition by the two subdomains of these Dieckmann cyclases.