Functional genes, namely hzo/hao, nirS, hzs, and ccs gene, are efficient with high specificity for detecting anammox bacteria. Sc-nirS and An-nirS primer sets were proposed for targeting Scalindua/non-Scalindua anammox bacterial groups; previously, they have not been assessed for biogeographic study on marine-terrestrial transitional systems, specifically marine and terrestrial ecosystems. Here, we report phylogenetic distribution pattern of anammox bacteria in both northern South China Sea (nSCS) and Mai Po wetland (a coastal mangrove) using nirS gene-based primers. A well-delineated biogeographic distribution pattern from ocean to continental shelf was evident by combining both gene-based analyses as previously depicted using 16S rRNA as the biomarker. Furthermore, factors affecting the abundance and composition of An-nirS genes in Mai Po wetland were identified as substrate (NO3-/NO2- concentration) and anoxic/oxic condition in association to depth. An-nirS gene abundance was from 2.6 × 103 to 1.2-1.4 × 104 copies/g dry sediment in nSCS; and it was around 5 × 103 and 1-2 × 104 copies/g dry sediment in surface and subsurface sediments of Mai Po wetland, respectively. In addition, nirS gene abundance and distribution pattern of denitrifiers and anammox bacteria in the wetland indicates a competition relationship between them. Mangrove vegetation affected the community composition of An-nirS gene considerably, and a more homogeneous distribution pattern was observed in the mangrove forest than intertidal mudflats. Sc/An-nirS gene-based biogeographic insights on anammox bacteria have shed lights on the compositional and potential functional dynamics and emphasized the importance of molecular tools on refining the current microbial ecological patterns.