Background: Soil phosphorus (p) availability limits the native microbial activity, which then inhibits the petroleum hydrocarbon biodegradation. Microbial communities harbouring the alkaline phosphatase (ALP) phoD gene ( phoD -harboring bacteria community, hereafter) play the key roles in the regulation of P availability in soils. Nevertheless, the consequences of oil contamination on ALP activity and phoD -harboring bacterial community dynamics are poorly understood. It is necessary to assess phoD -harboring bacterial abundance, community diversity, and ALP activity in response to oil contamination. This information would be useful for formulating plans for future bioremediation processes. Methods: In this study, we sampled the contaminated and uncontaminated soils in the area surrounding crude oil pumping wells at the Changqing oilfield. The Real-time Quantitative PCR (qPCR) was used to detect the abundance of phoD gene. The diversities and compositions of phoD -haboring microbial communities were illustrated via Illumina high-throughput sequencing. Coincident soil chemical properties (soil water content (SWC), total petroleum hydrocarbons (TPHs), total nitrogen (TN), soil organic carbon (SOC), total phosphorus (TP), nitrate (NO 3 - -N), ammonium (NH 4 + -N), dissolved organic carbon (DOC), available phosphorus (AP)) and ALP activities were also quantified. Results: We observed that petroleum contamination markedly decreased the abundance, richness, and diversity of the phoD -harboring bacterial community but greatly enhanced the relative abundance of phoD -harboring Actinomycetia, Thermoleophilia, and Rubrobacteria ( p < 0.05). The relative abundances of phoD -harboring Alphaproteobacteria, Betaproteobacteria, and Gammaproteobacteria showed an increasing tendency and then decreased as the oil contamination concentration increased ( p < 0.05). The soil water, nutrient content [carbon (C), nitrogen (N), and phosphorus], and nutrient ratio were the crucial parameters influencing the phoD -harboring bacterial community responding to oil contamination. The activity of ALP was associated positively and negatively with the relative abundance of Betaproteobacteria and Rubrobacteria, respectively. Discussion: Overall, the oil pollution stress altered the abundance, richness and composition of the active phoD -harboring functional microbial community. A significant decline in ALP activity in the oil-contaminated soils was likely caused by reduced abundance and changes in the composition of the phoD -harboring bacterial community, which were strongly dependent on the available N and P contents.