Uridine-diphospho-N-acetylglucosamine (UDP-GlcNAc) is a precursor of the bacterial and fungal cell wall. It is also used in a component of N-linked glycosylation and the glycosylphosphoinositol anchor of eukaryotic proteins. It is synthesized from N-acetylglucosamine-1-phosphate (GlcNAc-1-P) and uridine-5'-triphosphate (UTP) by UDP-GlcNAc pyrophosphorylase (UAP). This is an S(N)2 reaction; the non-esterified oxygen atom of the GlcNAc-1-P phosphate group attacks the alpha-phosphate group of UTP. We determined crystal structures of UAP from Candida albicans (CaUAP1) without any ligands and also complexed with its substrate or with its product. The series of structures in different forms shows the induced fit movements of CaUAP1. Three loops approaching the ligand molecule close the active site when ligand is bound. In addition, Lys-421, instead of the metal ion in prokaryotic UAPs, is coordinated by both phosphate groups of UDP-Glc-NAc and acts as a cofactor. However, a magnesium ion enhances the enzymatic activity of CaUAP1, and thus we propose that the magnesium ion increases the affinity between UTP and the enzyme by coordinating to the alpha- and gamma-phosphate group of UTP.