Submarine groundwater discharge to coastal waters can be a significant source of both contaminants and biologically limiting nutrients. Nitrogen cycling across steep gradients in salinity, oxygen and dissolved inorganic nitrogen in sandy ‘subterranean estuaries’ controls both the amount and form of nitrogen discharged to the coastal ocean. We determined the effect of these gradients on betaproteobacterial ammonia-oxidizing bacteria (β-AOB) and ammonia-oxidizing archaea (AOA) in a subterranean estuary using the functional gene encoding ammonia monooxygenase subunit A (amoA). The abundance of β-AOB was dramatically lower in the freshwater stations compared with saline stations, while AOA abundance remained nearly constant across the study site. This differing response to salinity altered the ratio of β-AOB to AOA such that bacterial amoA was 30 times more abundant than crenarchaeal amoA at the oxic marine station, but nearly 10 times less abundant at the low-oxygen fresh and brackish stations. As the location of the brackish mixing zone within the aquifer shifted from landward in winter to oceanward in summer, the location of the transition from a β-AOB-dominated to an AOA-dominated community also shifted, demonstrating the intimate link between microbial communities and coastal hydrology. Analysis of ammonia-oxidizing enrichment cultures at a range of salinities revealed that AOA persisted solely in the freshwater enrichments where they actively express amoA. Diversity (as measured by total richness) of crenarchaeal amoA was high at all stations and time points, in sharp contrast to betaproteobacterial amoA for which only two sequence types were found. These results offer new insights into the ecology of AOA and β-AOB by elucidating conditions that may favour the numerical dominance of β-AOB over AOA in coastal sediments.