Triterpenoids are a diverse group of secondary metabolites that are associated with a variety of biological activities. Oleanolic acid, ursolic acid and betulinic acid are common triterpenoids in plants with diverse biological activities, including antifungal, antibacterial, anti-human immunodeficiency virus (HIV) and/or antitumor activities. In the present study, using the gene co-expression analysis tool of Medicago truncatula, we found a strong correlation between CYP716A12 and β-amyrin synthase (bAS), which encodes the enzyme responsible for the initial cyclization of 2,3-oxidosqualene to β-amyrin (the basic structural backbone of most triterpenoid saponins). Through an in vitro assay, we identified CYP716A12 as a β-amyrin 28-oxidase able to modify β-amyrin to oleanolic acid (through erythrodiol and, possibly, oleanolic aldehyde). We also confirmed its activity in vivo, by expressing CYP716A12 in transgenic yeast that endogenously produce β-amyrin. In addition, CYP716A12 was evaluated for its potential α-amyrin- and lupeol-oxidizing activities. Interestingly, CYP716A12 was able to generate ursolic acid (through uvaol and, possibly, ursolic aldehyde) and betulinic acid (through betulin). Hence, CYP716A12 was characterized as a multifunctional enzyme with β-amyrin 28-oxidase, α-amyrin 28-oxidase and lupeol 28-oxidase activities. We also identified homologs of CYP716A12 in grape (CYP716A15 and CYP716A17) that are involved in triterpenoid biosynthesis, which indicates the highly conserved functionality of the CYP716A subfamily among plants. These findings will be useful in the heterologous production of pharmacologically and industrially important triterpenoids, including oleanolic acid, ursolic acid and betulinic acid.