Abstract:[Background]This study aimed to clarify the distribution characteristics and environmental driving mechanisms of soil nitrogen (N) cycling functional genes in walnut orchards along different altitude gradients in Gyatsa County, Tibet. Focusing on orchards at altitudes of 3000–3600 m, we analyzed the abundance and diversity of these genes and their relationships with soil physicochemical properties, to provide a scientific basis for precision fertilization and soil conservation in high-altitude walnut orchards.[Method]Soil samples were collected from walnut orchards at four altitudes (3112 m, 3248 m, 3364 m, 3550 m) in Gyatsa County. Using Illumina metagenomic sequencing coupled with conventional soil physicochemical analysis, we systematically investigated the abundance, diversity, and composition of source organisms of N cycling functional genes. Principal component analysis (PCA), Linear Discriminant Analysis Effect Size (LEfSe), and redundancy analysis (RDA) were employed to decipher the influence of environmental factors.[Result]The soil in the four walnut orchards is alkaline, with average total nitrogen (TN) and available nitrogen (AN) contents of 0.04 g/kg and 2.02 mg/kg, respectively. The overall abundance of N cycling functional genes exhibited an increasing trend with rising altitude, with the number of genes at 3550 m being significantly higher than in lower altitude zones. The dominant N transformation processes varied across altitude gradients: nitrogen mineralization and denitrification were predominant at 3112 m; dissimilatory and assimilatory nitrate reduction and nitrification were dominant at 3248 m; biological nitrogen fixation and nitrogen assimilation were primary at 3364 m; whereas nitrogen uptake processes were dominant at 3550 m. High-altitude environments (3364 m and 3550 m) harbored more unique genes, indicating stronger environmental specificity. Regarding microbial community composition, the phylum Actinobacteria was dominant at higher altitudes, while Proteobacteria showed higher abundance in the lower altitude (3112 m) samples. Among the environmental factors, soil pH, organic matter (SOM), total nitrogen (TN), and available nitrogen (AN) content were the primary factors influencing the distribution of key N cycling functional genes, such as metE, nirK, and nasA.[Conclusion]Soils in high-altitude walnut orchards of Tibet exhibit low nitrogen content, indicating severe nitrogen deficiency. The distribution of functional genes involved in soil nitrogen cycling demonstrates significant altitudinal variation, with key environmental factors such as pH, SOM, TN, and AN playing critical regulatory roles. Under high-altitude conditions, microbial communities tend to adapt to soil nitrogen limitation by enhancing nitrogen fixation capacity and adopting nitrogen retention strategies.