Glycolate oxidase (GOX) is an essential enzyme involved in photorespiratory metabolism in plants. In cyanobacteria and green algae, the corresponding reaction is catalyzed by glycolate dehydrogenases (GlcD). The genomes of N2-fixing cyanobacteria, such as Nostoc PCC 7120 and green algae, appear to harbor genes for both GlcD and GOX proteins. The GOX-like proteins from Nostoc (No-LOX) and from Chlamydomonas reinhardtii showed high l-lactate oxidase (LOX) and low GOX activities, whereas glycolate was the preferred substrate of the phylogenetically related At-GOX2 from Arabidopsis thaliana. Changing the active site of No-LOX to that of At-GOX2 by site-specific mutagenesis reversed the LOX/GOX activity ratio of No-LOX. Despite its low GOX activity, No-LOX overexpression decreased the accumulation of toxic glycolate in a cyanobacterial photorespiratory mutant and restored its ability to grow in air. A LOX-deficient Nostoc mutant grew normally in nitrate-containing medium but died under N2-fixing conditions. Cultivation under low oxygen rescued this lethal phenotype, indicating that N2 fixation was more sensitive to O2 in the Δlox Nostoc mutant than in the wild type. We propose that LOX primarily serves as an O2-scavenging enzyme to protect nitrogenase in extant N2-fixing cyanobacteria, whereas in plants it has evolved into GOX, responsible for glycolate oxidation during photorespiration.