Requires Mg2+. It is composed of two components, dinitrogen reductase and dinitrogenase, that can be separated but are both required for nitrogenase activity. Dinitrogen reductase is a [4Fe-4S] protein, which, at the expense of ATP, transfers electrons from a dedicated flavodoxin to dinitrogenase. Dinitrogenase is a protein complex that contains either a molybdenum-iron cofactor, a vanadium-iron cofactor, or an iron-iron cofactor, that reduces dinitrogen in three succesive two-electron reductions from nitrogen to diimine to hydrazine to two molecules of ammonia. The reduction is initiated by formation of hydrogen. The enzyme can also reduce acetylene to ethylene (but only very slowly to ethane), azide to nitrogen and ammonia, and cyanide to methane and ammonia. In the absence of a suitable substrate, hydrogen is slowly formed. Some enzymes utilize ferredoxin rather than flavodoxin as the electron donor (see EC 220.127.116.11, nitrogenase).