The occurrence of excessive ammonium in groundwater threatens human and aquatic ecosystem health across many places worldwide. As the fate of ammonium in groundwater systems is often affected by a complex mixture of transport and biogeochemical transformation processes, identifying the sources of groundwater ammonium is an important prerequisite for planning effective mitigation strategies. Elevated ammonium was found in both a shallow and an underlying deep groundwater system in an alluvial aquifer system beneath an agricultural area in the central Yangtze River Basin, China. In this study we develop and apply a novel, indirect approach, which couples the random forest classification (RFC) of machine learning method and fluorescence excitation-emission matrices with parallel factor analysis (EEM-PARAFAC), to distinguish multiple sources of ammonium in a multi-layer aquifer. EEM-PARAFAC was applied to provide insights into potential ammonium sources as well as the carbon and nitrogen cycling processes affecting ammonium fate. Specifically, RFC was used to unravel the different key factors controlling the high levels of ammonium prevailing in the shallow and deep aquifer sections, respectively. Our results reveal that high concentrations of ammonium in the shallow groundwater system primarily originate from anthropogenic sources, before being modulated by intensive microbially mediated nitrogen transformation processes such as nitrification, denitrification and dissimilatory nitrate reduction to ammonium (DNRA). By contrast, the linkage between high concentrations of ammonium and decomposition of soil organic matter, which ubiquitously contained nitrogen, suggested that mineralization of soil organic nitrogen compounds is the primary mechanism for the enrichment of ammonium in deeper groundwaters.