The anaerobic ammonium oxidation (anammox) bacteria transform ammonium and nitrite to dinitrogen gas, and this obligate anaerobic process accounts for nearly half of global nitrogen loss. Yet its origin and evolution, which may give important insights into the biogeochemistry of early Earth, remains enigmatic. Here, we compile a comprehensive sequence data set of anammox bacteria, and confirm their single origin within the phylum Planctomycetes. After accommodating the uncertainties and factors influencing time estimates with different statistical methods, we estimate that anammox bacteria originated at around the so-called Great Oxidation Event (GOE; 2.32 to 2.5 billion years ago [Gya]) which is thought to have fundamentally changed global biogeochemical cycles. We further show that during the origin of anammox bacteria, genes involved in oxidative stress, bioenergetics and anammox granules formation were recruited, which may have contributed to their survival in an increasingly oxic Earth. Our findings suggest the rising level of atmospheric oxygen, which made nitrite increasingly available, as a potential driving force for the emergence of anammox bacteria. This is one of the first studies that link GOE to the evolution of obligate anaerobic bacteria.