Seagrass ecosystems are among the most productive marine ecosystems, and diazotrophic communities play a crucial role in sustaining the productivity and stability of such ecosystems by introducing fixed nitrogen. However, information concerning both total and active diazotrophic groups existing in different compartments of seagrass is lacking. This study comprehensively investigated the diversity, structure, and abundance of diazotrophic communities in different parts of the seagrass Halophila ovalis at the DNA and RNA level from clone libraries and real-time quantitative PCR. Our results indicated that nearly one-third of existing nitrogen-fixing bacteria were active, and their abundance might be controlled by nitrogen to phosphorus ratio (N:P). Deltaproteobacteria and Gammaproteobacteria were dominant groups among the total and active diazotrophic communities in all samples. These two groups accounted for 82.21% and 70.96% at the DNA and RNA levels, respectively. The genus Pseudomonas and sulfate-reducing bacteria (genera: Desulfosarcina, Desulfobulbus, Desulfocapsa, and Desulfopila) constituted the significant fraction of nitrogen-fixing bacteria in the seagrass ecosystem, playing an additional role in denitrification and sulfate reduction, respectively. Moreover, the abundance of the nitrogenase gene, nifH, was highest in seawater and lowest in rhizosphere sediments from all samples. This study highlighted the role of diazotropic communities in the subtropical seagrass ecosystem.