Salinization damages soil system health and influences microbial communities structure and function. The response of microbial functions involved in the nutrient cycle to soil salinization is a valuable scientific question. However, our knowledge of the microbial metabolism functions in salinized soil and their response to salinity in arid desert environments is inadequate. Here, we applied metagenomics technology to investigate the response of microbial carbon (C), nitrogen (N), phosphorus (P), and sulfur (S) cycling and the key genes to salinity, and discuss the effects of edaphic variables on microbial functions. We found that carbon fixation dominated the carbon cycle. Nitrogen fixation, denitrification, assimilatory nitrate reduction (ANRA), and nitrogen degradation were commonly identified as the most abundant processes in the nitrogen cycle. Organic phosphorus dissolution and phosphorus absorption/transport were the most enriched P metabolic functions, while sulfur metabolism was dominated by assimilatory sulfate reduction (ASR), organic sulfur transformation, and linkages between inorganic and organic sulfur transformation. Increasing salinity inhibited carbon degradation, nitrogen fixation, nitrogen degradation, anammox, ANRA, phosphorus absorption and transport, and the majority of processes in sulfur metabolism. However, some of the metabolic pathway and key genes showed a positive response to salinization, such as carbon fixation (facA, pccA, korAB), denitrification (narG, nirK, norBC, nosZ), ANRA (nasA, nirA), and organic phosphorus dissolution processes (pstABCS, phnCD, ugpAB). High salinity reduced the network complexity in the soil communities. Even so, the saline microbial community presented highly cooperative interactions. The soil water content had significantly correlations with C metabolic genes. The SOC, N, and P contents were significantly correlated with C, N, P, and S network complexity and functional genes. AP, NH4+, and NO3- directly promote carbon fixation, denitrification, nitrogen degradation, organic P solubilization and mineralization, P uptake and transport, ASR, and organic sulfur transformation processes. Soil salinity in arid region inhibited multiple metabolic functions, but prompted the function of carbon fixation, denitrification, ANRA, and organic phosphorus dissolution. Soil salinity was the most important factor driving microbial functions, and nutrient availability also played important roles in regulating nutrient cycling.