The bacteriostatic natural product enterocin from the marine microbe "Streptomyces maritimus" has an unprecedented carbon skeleton that is derived from an aromatic polyketide biosynthetic pathway. Its caged tricyclic, nonaromatic core is derived from a linear poly-beta-ketide precursor that formally undergoes a Favorskii-like oxidative rearrangement. In vivo characterization of the gene encM through mutagenesis and heterologous biosynthesis demonstrated that its protein product not only is solely responsible for the oxidative C-C rearrangement, but also facilitates two aldol condensations plus two heterocycle forming reactions. In total, at least five chiral centers and four rings are generated by this multifaceted flavoprotein. Heterologous expression of the enterocin biosynthesis genes encABCDLMN in Streptomyces lividans resulted in the formation of the rearranged metabolite desmethyl-5-deoxyenterocin and the shunt products wailupemycins D-G. Addition of the methyltransferase gene encK, which was previously proposed through mutagenesis to additionally assist EncM in the Favorskii rearrangement, shifted the production to the O-methyl derivative 5-deoxyenterocin. The O-methyltransferase EncK seems to be specific for the pyrone ring of enterocin, because bicyclic polyketides bearing pyrone rings are not methylated in vivo. Expression of encM with different combinations of homologous actinorhodin biosynthesis genes did not result in the production of oxidatively rearranged enterocin-actinorhodin hybrid compounds as anticipated, suggesting that wild-type EncM may be specific for its endogenous type II polyketide synthase or for benzoyl-primed polyketide precursors.