Drought is a bottleneck for worldwide soybean production which is getting more serious as the climate continues to worsen. Dehydration responsive element binding (DREB) is a kind of transcription factor that regulates the expression of stress tolerance-related genes in response to drought, high salinity and cold stress in plant. Soybean with DREB gene possesses the drought resisting capability which is helpful to increase the yield. However, the potential risk of genetically modified plants (GMPs) on soil microbial community is still in debate. In order to understand the effects of transgenic DREB soybean on the nitrogen-fixing bacteria, the diversity of nifH gene in pot experiments planted transgenic soybean and near-isogenic nontransgenic soybean under normal water condition and drought stress condition was analyzed by PCR-DGGE and sequence analysis. The results showed that transgenic soybean under normal water condition decrease the diversity of the nitrogen-fixing bacteria in the seeding stage and flowering stage, but had no notable effect in other stages. Under drought stress, transgenic soybean reduced the diversity of the nitrogen-fixing bacteria in the flowering stage, but had no notable effects on other stages. Phylogenic analysis revealed that g7, g13, g15 and g19 had a close relationship with Alphaproteobacteria, g12 had a close relationship with Azonexus, others were related to Betaproteobacteria and Burkholderia.