(S)-Tetrahydroberberine [(S)-THB] oxidase is the last enzyme of benzylisoquinoline alkaloids pathway which catalyzes the dehydrogenation of four hydrogen atoms of (S)-THB to produce berberine, the final step of berberine biosynthesis. A (S)-THB gene, designated as Cs(S)-THBO (Genbank accession No. HQ393909), was cloned from a Corydalis saxicola cDNA library by rapid amplification of cDNA ends. The full-length of cDNA of Cs(S)-THBO was 1127 bp with an open reading frame of 699 bp that predicted to encode a 232-amino acid polypeptide, with a predicted molecular mass of 25.20 kDa. Cs(S)-THBO was the first (S)-THBO gene found in C. saxicola. Real-time quantitative PCR analysis indicated that Cs(S)-THBO was constitutively expressed in roots, stems, leaves and flowers of C. saxicola, and with the highest expression level in roots. The results of treatment experiment for plant defense responses revealed that expression of Cs(S)-THBO had a prominent diversity. Recombinant Cs(S)-THBO protein expressed in Escherichia coli strain BL21 (DE3) was active. The results of feeding experiment and HPLC-DAD-ESI-MS(n) analysis showed that Cs(S)-THBO had the function of catalyzing (S)-tetrahydroberberine to berberine.