It was previously reported that afforestation in the desert can help improve soil texture, carbon accumulation, and nutrient status. However, the effects of afforestation on soil microbial composition, diversity, and microbial interactions with soil physicochemical properties have been rarely evaluated quantitatively. Using the method of space-for-time substitutions, we assessed the development and determinants of topsoil bacterial and fungal communities over nearly 40 years of successive afforestation by aerial sowing in Tengger Desert, China. The results showed that afforestation by aerial sowing comprised a considerable proportion of Chloroflexi and Acidobacteria in the bacterial community in addition to the ubiquitous phyla found in desert but had fewer effects on the dominant phyla of the fungal community. At the phylum level, the bacterial community was clearly clustered into two groups. However, it was difficult to differentiate the constituents of the fungal community based on principal coordinate analysis. The richness of the bacterial and fungal communities was significantly higher after five years than at zero years and three years. Additionally, the bacterial community varied parabolically and reached its largest size at twenty years, while the fungal community increased exponentially. Soil physicochemical properties were found to have divergent effects on the abundance and diversity of bacterial and fungal communities, among which salt- and carbon-associated properties (e.g., electrical conductivity, calcium, magnesium, total carbon, and organic carbon) were closely related with the abundance of bacterial-dominant phyla and the diversity of bacteria and fungi, but nutrient-associated properties (e.g., total phosphorus and available phosphorus) were not. The results indicate that afforestation through the salt secretions of plants leaves and carbon inputs from litter promote the development of topsoil bacterial and fungal communities in the desert.