Stephacidin and notoamide natural products belong to a group of prenylated indole alkaloids containing a core bicyclo[2.2.2]diazaoctane ring system. These bioactive fungal secondary metabolites have a range of unusual structural and stereochemical features but their biosynthesis has remained uncharacterized. Herein, we report the first biosynthetic gene cluster for this class of fungal alkaloids based on whole genome sequencing of a marine-derived Aspergillus sp. Two central pathway enzymes catalyzing both normal and reverse prenyltransfer reactions were characterized in detail. Our results establish the early steps for creation of the prenylated indole alkaloid structure and suggest a scheme for the biosynthesis of stephacidin and notoamide metabolites. The work provides the first genetic and biochemical insights for understanding the structural diversity of this important family of fungal alkaloids.