Aim: Anthropogenic fires are a major component of the ecology of rangelands throughout the world. To assess the effects of these fires on the diversity patterns of herbivores, we related gradients in fire occurrence, climate and soil fertility to patterns in alpha and beta diversity of African ungulates. Location: West Africa. Methods: We used a survey-based approach for ungulates in 37 protected areas in desert, savanna and rain forest habitats throughout West Africa, combined with satellite images of fire occurrence and digital maps of actual evapotranspiration and soil fertility. Alpha diversity was related to the environmental variables using conventional and spatial regression models. We investigated beta diversity using partial Mantel tests and ordination techniques, and by partitioning the variance in assemblage composition into environmental and spatial components. Results: The species richness of grazers showed a quadratic relationship with actual evapotranspiration, whereas that of browsers and frugivores showed a linear relationship. However, in the multiple regression models fire occurrence was the only variable that significantly correlated with the species richness of grazers. Soil fertility was weakly related to overall beta diversity and the species richness of browsers, but was non-significant in the multiple regression models. Fire occurrence was the most important variable explaining species composition of the overall species set and of grazers, whereas the assemblage composition of browsers and frugivores was explained mostly by actual evapotranspiration. Main conclusions: In contrast to previous studies, our analyses show that moisture and nutrients alone fail to adequately predict the diversity patterns of grazing ungulates. Rather, the species richness and assemblage composition of grazers are largely governed by anthropogenic fires that modify the quality and structure of the grass sward. Diversity patterns of browsers and frugivores are markedly different from grazers and depend mainly on the availability of moisture, which is positively correlated with the availability of foliage and fruits. Our study highlights the importance of incorporating major human-induced disturbances or habitat alterations into analyses of diversity patterns.