Polyketides are a class of natural products with diverse structures and biological activities. The structural variability of aromatic products of fungal nonreducing, multidomain iterative polyketide synthases (NR-PKS group of IPKSs) results from regiospecific cyclizations of reactive poly-beta-keto intermediates. How poly-beta-keto species are synthesized and stabilized, how their chain lengths are determined, and, in particular, how specific cyclization patterns are controlled have been largely inaccessible and functionally unknown until recently. A product template (PT) domain is responsible for controlling specific aldol cyclization and aromatization of these mature polyketide precursors, but the mechanistic basis is unknown. Here we present the 1.8 A crystal structure and mutational studies of a dissected PT monodomain from PksA, the NR-PKS that initiates the biosynthesis of the potent hepatocarcinogen aflatoxin B(1) in Aspergillus parasiticus. Despite having minimal sequence similarity to known enzymes, the structure displays a distinct 'double hot dog' (DHD) fold. Co-crystal structures with palmitate or a bicyclic substrate mimic illustrate that PT can bind both linear and bicyclic polyketides. Docking and mutagenesis studies reveal residues important for substrate binding and catalysis, and identify a phosphopantetheine localization channel and a deep two-part interior binding pocket and reaction chamber. Sequence similarity and extensive conservation of active site residues in PT domains suggest that the mechanistic insights gleaned from these studies will prove general for this class of IPKSs, and lay a foundation for defining the molecular rules controlling NR-PKS cyclization specificity.