The microorganisms responsible for driving the Anammox and Sammox processes may have ancient origins and remain poorly understood. In this research, we enriched the microorganisms from paddy soils and marine sediments under Anammox and Sammox conditions to investigate the shifts in their structure and functions. The community structure showed significant differences between enrichment cultures of paddy soils and marine sediments under the Anammox and Sammox conditions. Among samples from paddy soils, Proteobacteria, Nitrospirota, Verrucomicrobiota, Gemmatimonadata, and Euryarchaeota accounted for a larger proportion under Anammox culture conditions, while Firmicutes, Bacteroidota, Chloroflexi, Planctomycetota, Acidobacteriota, Crenarchaeota, and Nanoarchaeota accounted for a larger proportion under Sammox culture conditions. Among samples from marine sediments, Proteobacteria, Bacteroidota, and Euryarchaeota accounted for a larger proportion in the Anammox culture conditions, while Firmicutes, Chloroflexi, Crenarchaeota, and Nanoarchaeota accounted for a larger proportion in Sammox culture conditions. Genes associated with assimilatory sulfate reduction, nitrate reduction, and denitrification pathways were more abundant under Anammox culture conditions, whereas genes related to dissimilatory sulfate reduction and nitrification pathways were more prevalent under Sammox culture conditions. These findings provide valuable insights into the ecological conditions and microbial species of the primordial era and may aid in the searching for extraterrestrial life.