Fungal bicyclo[2.2.2]diazaoctane indole alkaloids represent an important family of natural products with a wide-spectrum of biological activities. Although biomimetic total syntheses have been completed for representative compounds, the details of their biogenesis, especially the mechanisms for assembly of diastereomerically distinct and enantiomerically antipodal metabolites, have remained largely uncharacterized. Brevianamide A represents the most basic form of the sub-family bearing a dioxopiperazine core and a rare 3-spiro-ψ-indoxyl skeleton. Here, we identified the Brevianamide A biosynthetic gene cluster from Penicillium brevicompactum NRRL 864 and fully elucidated the metabolic pathway by gene disruption, heterologous expression, precursor incorporation experiments, and in vitro biochemical analysis. In particular, we determined BvnE as a cofactor-independent isomerase/pinacolase that is essential for selective production of Brevianamide A. Structural elucidation, molecular modeling, and mutational analysis of BvnE, and quantum chemical calculations provided critical mechanistic insights into the diastereoselective formation of the 3-spiro-ψ-indoxyl moiety in Brevianamide A. This occurs through a BvnE-controlled semi-pinacol rearrangement and a subsequent spontaneous intramolecular [4+2] hetero-Diels-Alder cycloaddition. Resolution of this 50-year old mechanistic mystery together with our recent characterization of the Diels-Alderase-mediated biogenesis of monooxopiperazines highlight the diversified biosynthetic strategies deployed by fungi for creating structurally diverse spiro-cyclized indole alkaloids.Fungal indole alkaloids bearing the unusual bicyclo[2.2.2]diazaoctane core have drawn considerable attention from natural product, synthetic and biological chemists for decades. A wealth of studies on the discovery of analogs (including semi-synthetic, synthetic and natural), biological activities and biosynthetic mechanisms have been