(Iso)flavonoids are a diverse group of plant secondary metabolites with important effects on plant, animal and human health. They exist in various glycosidic forms. Glycosylation, which may determine their bioactivities and functions, is controlled by specific plant uridine diphosphate glycosyltransferases (UGTs). We describe a new multifunctional (iso)flavonoid glycosyltransferase, UGT85H2, from the model legume Medicago truncatula with activity towards a number of phenylpropanoid-derived natural products including the flavonol kaempferol, the isoflavone biochanin A, and the chalcone isoliquiritigenin. The crystal structure of UGT85H2 has been determined at 2.1 A resolution, and reveals distinct structural features that are different from those of other UGTs and related to the enzyme's functions and substrate specificities. Structural and comparative analyses revealed the putative binding sites for the donor and acceptor substrates that are located in a large cleft formed between the two domains of the enzyme, and indicated that Trp360 may undergo a conformational change after sugar donor binding to the enzyme. UGT85H2 has higher specificity for flavonol than for isoflavone. Further substrate docking combined with enzyme activity assay and kinetic analysis provided structural insights into this substrate specificity and preference.