β-Carboline (βC) alkaloids constitute a large family of indole alkaloids that exhibit diverse pharmacological properties, such as antitumor, antiviral, antiparasitic, and antimicrobial activities. Here, we report that a flavoprotein StnP2 catalyzes the dehydrogenation at C1-N2 of a tetrahydro-β-carboline (THβC) generating a 3,4-dihydro-β-carboline (DHβC), and the DHβC subsequently undergoes a spontaneous dehydrogenation to βC formation involved in the biosynthesis of the antitumor agent streptonigrin. Biochemical characterization showed that StnP2 catalyzed the highly regio- and stereo-selective dehydrogenation, and StnP2 exhibits promiscuity toward different THβCs. This study provides an alternative kind of enzyme catalyzing the biosynthesis of βC alkaloids and enhances the importance of flavoproteins.