A thermochemical-hydrodynamic model of the production of trace species by electrical discharges has been used to estimate the rates of fixation of C and N by lightning in the primitive atmosphere. Calculations for various possible mixtures of CH4, CO2, CO, N2, H2, and H2O reveal that the prime species produced were probably HCN and NO and that the key parameter determining the rates of fixation was the ratio of C atoms to O atoms in the atmosphere. Atmospheres with C more abundant than O have large HCN fixation rates, in excess of 10(17) molecules J-1, but small NO yields. However, when O is more abundant than C, the NO fixation rate approaches 10(17) molecules J-1 while the HCN yield is small. The implications for the evolution of life are discussed.