Phosphite, a reduced form of orthophosphate, is characterized by high solubility, and transportation efficiency and can be used as potential phosphorus fertilizer, plant biostimulant and supplemental fertilizer in agriculture. However, the effects of phosphite fertilizer on soil properties and microorganisms are poorly understood. This study evaluated the effects of phosphate and phosphite fertilizers on the different forms of phosphorus, alkaline phosphatase (ALP) activity, and phoD-harboring bacterial community in the alfalfa (Medicago sativa) field. The study used four concentrations (30, 60, 90, and 120 mg P2O5 kg−1 soil) of phosphate (KH2PO4) and phosphite (KH2PO3) fertilizers for the alfalfa field treatment. The results showed that both phosphite and phosphate fertilizers increased the total phosphorus (TP) and available phosphorus (AP) contents in the soil. The phosphorus content of the phosphite-treated soil was lower than that of the phosphate-treated one. TP, inorganic phosphate (Pi), and AP negatively regulated ALP activity, which decreased with increasing phosphate and phosphite fertilizers concentrations. Furthermore, high-throughput sequencing analysis identified 6 phyla and 29 families, which were classified from the altered operational taxonomic units (OTUs) of the soil samples. The redundancy analysis (RDA) revealed that pH, TP, AP and Pi were significantly related to the phoD-harboring bacterial community constructure. The different fertilizer treatments altered the key families, contributing to soil ALP activities. Frankiaceae, Sphingomonadaceae, and Rhizobiaceae positively correlated with ALP activity in phosphite-treated soil. Moreover, the structural equation model (SEM) revealed that ALP activity was affected by the phoD-harboring bacterial community through altered organic phosphorus (Po), AP, total nitrogen (TN), soil organic carbon (SOC), and pH levels under phosphate fertilizer treatment. However, the effect was achieved through positive regulation of pH and AP under phosphite fertilizer. Thus, the changes in soil properties and phoD-harboring bacteria in response to phosphate and phosphite treatments differed in the alfalfa field. This study is the first to report the effects of phosphite on the soil properties of an alfalfa field and provides a strong basis for phosphite utilization in the future.Highlights– Phosphite and phosphate increase the total phosphorus and available phosphorus.– The pH was the dominant factor influencing the phoD-harboring bacterial community under phosphite fertilizer.– The response of soil properties and phoD-harboring bacterial community to phosphate and phosphite fertilizers differed in the alfalfa field.