Afforestation greatly alters soil nitrogen (N) dynamics and soil microbial community, but the response of soil N dynamics to microbial activity, particularly to that of N-fixing microbes, remains unclear. In the present study, soil samples were collected from areas with a chronosequence of 17, 27 and 42 years of Robinia pseudoacacia L (RP17a, RP27a, and RP42a) and a sloped farmland (FL) as a control. The nifH gene was sequenced with the Illumina MiSeq platform to analyze soil microbial diversity and composition, and soil N fractions (TN, AN, NN, MBN, DON) were estimated. The soil N stocks, N fractions, and diversity of N-fixing microorganisms increased with the chronosequence of R. pseudoacacia. Beta diversity, analyzed using nonmetric multidimensional scaling, revealed that afforestation effectively improved soil microbial communities. The profiles of the N-fixing microorganism communities at sites 17a, 27a and 42a were clearly separated from the farmland, and soil N-fixing microbial community compositions generally changed in the farmland from Actinobacteria-dominated to Proteobacteria- dominated with stand ages. Redundancy analysis revealed that soil N fractions were positively correlated with the main species, particularly for AN, which had a 34.7% explanatory space in axis one and was significantly correlated with the Proteobacteria at the phylum level. Results implied the evolutionary tendency of the dominant microbial groups, and demonstrated the variation of the N fractions and some other physical-chemistry properties along the chronosequence of R. pseudoacacia, and that AN was the most sensitive N fraction to the N-fixing microorganism composition. Thus, our results provide evidence that the variation of soil compositions of N-fixing microbial communities is linked to the level of N fractions, especially the content of AN.