Thiazole/oxazole-modified microcins (TOMMs) encompass a recently defined class of ribosomally synthesized natural products with a diverse set of biological activities. Although TOMM biosynthesis has been investigated for over a decade, the mechanism of heterocycle formation by the synthetase enzymes remains poorly understood. Using substrate analogs and isotopic labeling, we demonstrate that ATP is used to directly phosphorylate the peptide amide backbone during TOMM heterocycle formation. Moreover, we present what is to our knowledge the first experimental evidence that the D-protein component of the heterocycle-forming synthetase (YcaO/domain of unknown function 181 family member), formerly annotated as a docking protein involved in complex formation and regulation, is able to perform the ATP-dependent cyclodehydration reaction in the absence of the other TOMM biosynthetic proteins. Together, these data reveal the role of ATP in the biosynthesis of azole and azoline heterocycles in ribosomal natural products and prompt a reclassification of the enzymes involved in their installation.