The gateway to morphine biosynthesis in opium poppy (Papaver somniferum) is the stereochemical inversion of (S)-reticuline since the enzyme yielding the first committed intermediate salutaridine is specific for (R)-reticuline. A fusion between a cytochrome P450 (CYP) and an aldo-keto reductase (AKR) catalyzes the S-to-R epimerization of reticuline via 1,2-dehydroreticuline. The reticuline epimerase (REPI) fusion was detected in opium poppy and in Papaver bracteatum, which accumulates thebaine. In contrast, orthologs encoding independent CYP and AKR enzymes catalyzing the respective synthesis and reduction of 1,2-dehydroreticuline were isolated from Papaver rhoeas, which does not accumulate morphinan alkaloids. An ancestral relationship between these enzymes is supported by a conservation of introns in the gene fusions and independent orthologs. Suppression of REPI transcripts using virus-induced gene silencing in opium poppy reduced levels of (R)-reticuline and morphinan alkaloids and increased the overall abundance of (S)-reticuline and its O-methylated derivatives. Discovery of REPI completes the isolation of genes responsible for known steps of morphine biosynthesis.