Coenzyme F(420), a hydride carrier, is found in Archaea and some bacteria and has crucial roles in methanogenesis, antibiotic biosynthesis, DNA repair, and activation of antitubercular compounds. CofD, 2-phospho-l-lactate transferase, catalyzes the last step in the biosynthesis of F(420)-0 (F(420) without polyglutamate), by transferring the lactyl phosphate moiety of lactyl(2)diphospho-(5')guanosine to 7,8-didemethyl-8-hydroxy-5-deazariboflavin ribitol (Fo). CofD is highly conserved among F(420)-producing organisms, and weak sequence homologs are also found in non-F(420)-producing organisms. This superfamily does not share any recognizable sequence conservation with other proteins. Here we report the first crystal structures of CofD, the free enzyme and two ternary complexes, with Fo and P(i) or with Fo and GDP, from Methanosarcina mazei. The active site is located at the C-terminal end of a Rossmann fold core, and three large insertions make significant contributions to the active site and dimer formation. The observed binding modes of Fo and GDP can explain known biochemical properties of CofD and are also supported by our binding assays. The structures provide significant molecular insights into the biosynthesis of the F(420) coenzyme. Large structural differences in the active site region of the non-F(420)-producing CofD homologs suggest that they catalyze a different biochemical reaction.