Phenalenones are polyketide natural products that display diverse structures and biological activities. The core of phenalenones is a peri-fused tricyclic ring system cyclized from a linear polyketide precursor via an unresolved mechanism. Toward understanding the unusual cyclization steps, the phn biosynthetic gene cluster responsible for herqueinone biosynthesis was identified from the genome of Penicillium herquei. A nonreducing polyketide synthase (NR-PKS) PhnA was shown to synthesize the heptaketide backbone and cyclize it into the angular, hemiketal-containing naphtho-γ-pyrone prephenalenone. The product template (PT) domain of PhnA catalyzes only the C4-C9 aldol condensation, which is unprecedented among known PT domains. The transformation of prephenalenone to phenalenone requires an FAD-dependent monooxygenase (FMO) PhnB, which catalyzes the C2 aromatic hydroxylation of prephenalenone and ring opening of the γ-pyrone ring simultaneously. Density functional theory calculations provide insights into why the hydroxylated intermediate undergoes an aldol-like phenoxide-ketone cyclization to yield the phenalenone core. This study therefore unveiled new routes and biocatalysts for polyketide cyclization.