Acarbose is a bacterial-derived α-glucosidase inhibitor clinically used to treat patients with type 2 diabetes. As type 2 diabetes is on the rise worldwide, the market demand for acarbose has also increased. Despite its significant therapeutic importance, how it is made in nature is not completely understood. Here, we report the complete biosynthetic pathway to acarbose and its structural components, GDP-valienol and O-4-amino-(4,6-dideoxy-α-D-glucopyranosyl)-(1→4)-O-α-D-glucopyranosyl-(1→4)-D-glucopyranose. GDP-valienol is derived from valienol 7-phosphate, catalyzed by three cyclitol modifying enzymes, whereas O-4-amino-(4,6-dideoxy-α-D-glucopyranosyl)-(1→4)-O-α-D-glucopyranosyl-(1→4)-D-glucopyranose is produced from dTDP-4-amino-4,6-dideoxy-D-glucose and maltose by the glycosyltransferase AcbI. The final assembly process is catalyzed by a pseudoglycosyltransferase enzyme, AcbS, which is a homologue of AcbI but catalyzes the formation of a non-glycosidic C-N bond. This study clarifies all previously unknown steps in acarbose biosynthesis and establishes a complete pathway to this high value pharmaceutical.