The Amazon rainforest, the largest equatorial forest in the world, is being cleared for pasture and agricultural use at alarming rates. Tropical deforestation is known to cause alterations in microbial communities at taxonomic and phylogenetic levels, but it is unclear whether microbial functional groups are altered. We asked whether free-living nitrogen-fixing microorganisms (diazotrophs) respond to deforestation in the Amazon rainforest, using analysis of the marker gene nifH. Clone libraries were generated from soil samples collected from a primary forest, a 5-year-old pasture originally converted from primary forest, and a secondary forest established after pasture abandonment. Although diazotroph richness did not significantly change among the three plots, diazotroph community composition was altered with forest-to-pasture conversion, and phylogenetic similarity was higher among pasture communities than among those in forests. There was also 10-fold increase in nifH gene abundance following conversion from primary forest to pasture. Three environmental factors were associated with the observed changes: soil acidity, total N concentration, and C/N ratio. Our results suggest a partial restoration to initial levels of abundance and community structure of diazotrophs following pasture abandonment, with primary and secondary forests sharing similar communities. We postulate that the response of diazotrophs to land use change is a direct consequence of changes in plant communities, particularly the higher N demand of pasture plant communities for supporting aboveground plant growth.