Substitution of mineral fertilizers with milk vetch (Astragalus sinicus L.) organic fertilization strongly influences the dynamics and availability of phosphorus (P) in soil. How milk vetch organic fertilization affects the specific roles of P cycling functional genes in soil and, in turn, the mechanisms of altered P turnover remain unclear. Soil samples were taken from a 10-year field experiment that included mineral fertilizer and partial substitution of mineral fertilizer with milk vetch, together with an unfertilized control. The P-cycling functional genes in soil determined by metagenomics were related to phosphatase enzyme activities and P fractions with various availability. Milk vetch substitution decreased soil total P and NaHCO