Rifamycins have been clinically utilized against mycobacterial infections for more than 50 years; however, their biosynthesis has not been fully elucidated. Here, on the basis of in vivo gene deletions, in vitro enzyme assays, isotope labeling, and site-directed mutations, we found that a flavin-dependent monooxygenase encoded by a rifamycin biosynthetic gene cluster, Rif-Orf17, not only converted the naphthoquinone chromophore of rifamycin S into benzo-γ-pyrone but also linearized rifamycin SV through phenolic hydroxylation. Both oxidation routes lead to inactivation of rifamycins.