Aims Although phosphorus (P) availability and plant cultivation affect diazotrophic populations, studies often consider individual factors rather than their combined effects. Their relative importance to diazotrophs remains poorly understood, especially in acidic soils with P deficiency. It is hypothesized that the influences of P fertilization and plant cultivation on diazotrophic communities differ in acidic soils. The objectives were to investigate these influences and identify the key determining factors. Methods Maize was grown in an acidic soil that was supplemented with 0, 20, and 50 mg P kg(- 1)for 42 days. Maize biomasses, plant nutrient contents, and soil physicochemical properties were determined. Based on thenifHgene, the abundances and community compositions of diazotrophs in the different plant/soil compartments (bulk soils, rhizosphere soils, and roots) were respectively investigated using quantitative PCR and high-throughput sequencing. Results P fertilization significantly improved the diazotrophic abundances in the bulk and rhizosphere soils, but not in the roots. The plant/soil compartments had stronger effects on the abundance and diversity of diazotrophs than did P fertilization. Furthermore, the plant/soil compartments influenced diazotrophic community composition, but P fertilization did not. However, in the same sampling site, P fertilization caused community variations in the bulk and rhizosphere soils, rather than in the roots. Conclusions Although P fertilization affected the abundances and compositions of diazotrophic communities in the bulk and rhizosphere soils, the plant/soil compartments resulting from maize cultivation had more noticeable effects than did P fertilization. These findings improved the understanding of biological nitrogen fixation in acidic soils.