We conducted a study on small-mammal composition, abundance and diversity across altitudinal and vegetational gradients in the Urucum Mountains (from 150 to 1000 m asl) in western Brazil, a complex biogeographic region. Small mammals were collected in 31 sampling units distributed along altitudinal and vegetational gradients (forest and grassland), totalling 18 112 trap-nights for pitfall and 3500 trap-nights for live-trap. Community variation among sampling units was assessed by randomization tests, setting altitude, vegetation, locality and time as factors, and using presence/absence data. Correlation and logistic regression analyses were run for species and diversity along gradients of altitude and vegetation, according to abundance and presence/absence data. Nineteen species (seven marsupial and 12 rodent) and 355 individuals were recorded. The species composition of small mammals differed according to altitude, vegetation type, locality and time. Species diversity varied significantly according to altitude. Species were influenced solely by altitude or vegetation, or by both vegetation and altitude concomitantly. The small-mammal community was divided in two groups according to biogeographic affinities. The grassland group is capable of invading forest habitats. The results are discussed in light of current hypotheses that attempt to explain community variation along altitudinal gradients around the world.