Coastal ecosystems are hotspots for nitrogen cycling, and specifically for nitrogen removal from water and sediment through the coupled nitrification-denitrification process. Salinity is globally important in structuring bacterial and archaeal communities, but the association between salinity and microbially-mediated nitrification and denitrification remains unclear. The denitrification activity and composition and structure of microbial nitrifiers and denitrifiers were characterized across a gradient of manipulated salinity (0, 10, 20 and 30 ppt) in a mangrove sediment. Salinity negatively correlated with both denitrifying activity and the abundance of nirK and nosZ denitrifying genes. Ammonia-oxidizing bacteria (AOB), which dominated nitrification, had significantly greater abundance at intermediate salinity (10 and 20 ppt). However, a positive correlation between ammonia concentration and salinity suggested that nitrifying activity might also be inhibited at higher salinity. The community structure of ammonia-oxidizing archaea (AOA) and bacteria (AOB), as well as nirK, nirS and nosZ denitrifying communities, were all significantly correlated with salinity. These changes were also associated with structural shifts in phylogeny. These findings provide a strong evidence that salinity is a key factor that influences the nitrogen transformations in coastal wetlands, indicating that salinity intrusion caused by climate change might have a broader impact on the coastal biospheres.