Megalomicin is a therapeutically diverse compound which possesses antiparasitic, antiviral and antibacterial properties. It is produced by Micromonospora megalomicea and differs from the well-known macrolide antibiotic erythromycin by the addition of a unique deoxyamino sugar, megosamine, to the C-6 hydroxyl. We have cloned and sequenced a 48 kb segment of the megalomicin (meg) biosynthetic gene cluster which contains the modular polyketide synthase (PKS) and the complete pathway for megosamine biosynthesis. The similarities and distinctions between the related megalomicin and erythromycin gene clusters are discussed. Heterologous expression of the megalomicin PKS in Streptomyces lividans led to production of 6-deoxyerythronolide B, the same macrolactone intermediate for erythromycin. A 12 kb fragment harbouring the putative megosamine pathway was expressed in Saccharopolyspora erythraea, resulting in the conversion of erythromycin to megalomicin. Considering the extensive knowledge surrounding the genetic engineering of the erythromycin PKS and the familiarity with genetic manipulation and fermentation of S. erythraea, the ability to produce megalomicin in this strain should allow the engineering of novel megalomicin analogues with potentially improved therapeutic activities.