Spinosyns A and D (spinosad), like many other complex polyketides, are tailored near the end of their biosyntheses through the addition of sugars. SpnG, which catalyzes their 9-OH rhamnosylation, is also capable of adding other monosaccharides to the spinosyn aglycone (AGL) from TDP-sugars; however, the substitution of UDP-d-glucose for TDP-d-glucose as the donor substrate is known to result in a >60,000-fold reduction in kcat. Here, we report the structure of SpnG at 1.65 Å-resolution, SpnG bound to TDP at 1.86 Å-resolution, and SpnG bound to AGL at 1.70 Å-resolution. The SpnG-TDP complex reveals how SpnG employs N202 to discriminate between TDP- and UDP-sugars. A conformational change of several residues in the active site is promoted through the binding of TDP. The SpnG-AGL complex shows that the binding of AGL is mediated through hydrophobic interactions and that H13, the potential catalytic base, is within 3 Å of the nucleophilic AGL 9-OH. A model for the Michaelis complex was constructed to reveal the features that enable SpnG to transfer diverse sugars; it also revealed that the rhamnosyl moiety is in a skew-boat conformation during the transfer reaction.