Owing to the worrying increase in carbon dioxide concentrations in the atmosphere, there is a need to electrify fossil-fuel–powered chemical processes such as the Haber-Bosch ammonia synthesis. Lithium-mediated electrochemical nitrogen reduction has shown preliminary promise but still lacks sufficient faradaic efficiency and ammonia formation rate to be industrially relevant. Here, we show that oxygen, previously believed to hinder the reaction, actually greatly improves the faradaic efficiency and stability of the lithium-mediated nitrogen reduction when added to the reaction atmosphere in small amounts. With this counterintuitive discovery, we reach record high faradaic efficiencies of up to 78.0 ± 1.3% at 0.6 to 0.8 mole % oxygen in 20 bar of nitrogen. Experimental x-ray analysis and theoretical microkinetic modeling shed light on the underlying mechanism.