Nitrogenase, the only enzyme known to be able to reduce dinitrogen (N-2) to ammonia (NH3), is irreversibly damaged upon exposure to molecular oxygen (O-2). Several microbes, however, are able to grow aerobically and diazotrophically (fixing N-2 to grow) while containing functional nitrogenase. The obligate aerobic diazotroph, Azotobacter vinelandii, employs a multitude of protective mechanisms to preserve nitrogenase activity, including a "conformational switch" protein (FeSII, or "Shethna") that reversibly locks nitrogenase into a multicomponent protective complex upon exposure to low concentrations of O-2. We demonstrate in vitro that nitrogenase can be oxidatively damaged under anoxic conditions and that the aforementioned conformational switch can protect nitrogenase from such damage, confirming that the conformational change in the protecting protein can be achieved solely by regulating the potential of its [2Fe-2S] cluster. We further demonstrate that this protective complex preserves nitrogenase activity upon exposure to air. Finally, this protective FeSII protein was incorporated into an O-2-tolerant bioelectrosynthetic cell whereby NH3 was produced using air as a substrate, marking a significant step forward in overcoming the crippling limitation of nitrogenase's sensitivity toward O-2.