Phosphorus is a scarce nutrient in many tropical ecosystems, yet how soil microbial communities cope with growth-limiting phosphorus deficiency at the gene and protein levels remains unknown. Here, we report a metagenomic and metaproteomic comparison of microbial communities in phosphorus-deficient and phosphorus-rich soils in a 17-year fertilization experiment in a tropical forest. The large-scale proteogenomics analyses provided extensive coverage of many microbial functions and taxa in the complex soil communities. A greater than fourfold increase in the gene abundance of 3-phytase was the strongest response of soil communities to phosphorus deficiency. Phytase catalyses the release of phosphate from phytate, the most recalcitrant phosphorus-containing compound in soil organic matter. Genes and proteins for the degradation of phosphorus-containing nucleic acids and phospholipids, as well as the decomposition of labile carbon and nitrogen, were also enhanced in the phosphorus-deficient soils. In contrast, microbial communities in the phosphorus-rich soils showed increased gene abundances for the degradation of recalcitrant aromatic compounds, transformation of nitrogenous compounds and assimilation of sulfur. Overall, these results demonstrate the adaptive allocation of genes and proteins in soil microbial communities in response to shifting nutrient constraints.