Bergenin is a typical carbon glycoside and the primary active ingredient in antitussive drugs widely prescribed for central cough inhibition in China. The bergenin extraction industry relies on the medicinal plant species Bergenia purpurascens and Ardisia japonica as their resources. However, the bergenin biosynthetic pathway in plants remains elusive. In this study, we functionally characterized a shikimate dehydrogenase (SDH), two O-methyltransferases (OMTs), and a C-glycosyltransferase (CGT) involved in bergenin synthesis through bioinformatics analysis, heterologous expression, and enzymatic characterization. We found that BpSDH2 catalyzes the two-step dehydrogenation process of shikimic acid to form gallic acid (GA). BpOMT1 and AjOMT1 facilitate the methylation reaction at the 4-OH position of GA, resulting in the formation of 4-O-methyl gallic acid (4-O-Me-GA). AjCGT1 transfers a glucose moiety to C-2 to generate 2-Glucosyl-4-O-methyl gallic acid (2-Glucosyl-4-O-Me-GA). Bergenin production ultimately occurs in acidic conditions or via dehydration catalyzed by plant dehydratases following a ring-closure reaction. This study for the first time uncovered the biosynthetic pathway of bergenin, paving the way to rational production of bergenin in cell factories via synthetic biology strategies.