Context Although nitrogen (N) deposition application has resulted in excess N entering grassland ecosystems, our understanding of how short-term N enrichment affects soil microbial community in a desert steppe is incomplete. Aims This study assessed the effects of 2 years of N addition on structure and function of soil microbial community at the soil depth of 0–10 cm in a desert steppe. Methods Six addition rates of N (equivalent to 0, 5, 10, 15, 20 and 40 g N m−2 year−1) were applied in a desert steppe of northern China, and the 16S rRNA and ITS1 genes were sequenced for the prokaryotic and fungal communities, respectively. Key results N addition altered prokaryotic taxa composition, but not fungal taxa composition and α-diversities of prokaryotic and fungal communities. N shifted microbial β-diversities, and prokaryotic β-diversity was more sensitive than fungal β-diversity. Abundances of predicted prokaryotic functions decreased as N rates increased, whereas predicted fungal functions presented no obvious variations among N additions. Predicted enzyme activities related to N cycling in prokaryotes were similar to fungi, but variations of C and P cycling-related enzyme activities were opposite to fungi. Additionally, phylum abundance, α-diversity, and β-diversity of prokaryotes were more closely influenced by soil and plant properties than fungi. Conclusions Two years of N addition altered both microbial community structure and function, but the prokaryotic community responded more sensitive than the fungal community. Implications Topsoil should be considered when exploring the impact of short-term N addition on soil microbial community in the desert steppe.