Flavoprotein monooxygenases (FPMOs) play important roles in generating structural complexity and diversity in natural products biosynthesized by type II polyketide synthases (PKSs). In this study, we used genome mining to discover novel mutaxanthene analogues and investigated the biosynthesis of these aromatic polyketides and their unusual xanthene framework. We determined the complete biosynthetic pathway of mutaxathene through in vivo gene deletion and in vitro biochemical experiments. We show that a multifunctional FPMO, MtxO4, catalyzes ring rearrangement and generates the required xanthene ring through a multistep transformation. In addition, we successfully obtained all necessary enzymes for in vitro reconstitution and completed the total biosynthesis of mutaxanthene in a stepwise manner. Our results revealed the formation of a rare xanthene ring in type II polyketide biosynthesis, and demonstrate the potential of using total biosynthesis for the discovery of natural products synthesized by type II PKSs.