Ketopantoate reductase (KPR, EC 184.108.40.206) catalyzes the NADPH-dependent reduction of ketopantoate to pantoate, an essential step for the biosynthesis of pantothenate (vitamin B5). Inhibitors of the enzymes of this pathway have been proposed as potential antibiotics or herbicides. Here we present the crystal structure of Escherichia coli KPR in a precatalytic ternary complex with NADP+ and pantoate bound, solved to 2.3 A of resolution. The asymmetric unit contains two protein molecules, each in a ternary complex; however, one is in a more closed conformation than the other. A hinge bending between the N- and C-terminal domains is observed, which triggers the switch of the essential Lys176 to form a key hydrogen bond with the C2 hydroxyl of pantoate. Pantoate forms additional interactions with conserved residues Ser244, Asn98, and Asn180 and with two conservatively varied residues, Asn194 and Asn241. The steady-state kinetics of active site mutants R31A, K72A, N98A, K176A, S244A, and E256A implicate Asn98 as well as Lys176 and Glu256 in the catalytic mechanism. Isothermal titration calorimetry studies with these mutants further demonstrate the importance of Ser244 for substrate binding and of Arg31 and Lys72 for cofactor binding. Further calorimetric studies show that KPR discriminates binding of ketopantoate against pantoate only with NADPH bound. This work provides insights into the roles of active site residues and conformational changes in substrate recognition and catalysis, leading to the proposal of a detailed molecular mechanism for KPR activity.