Microbial communities respond to a variety of environmental factors related to resources (e.g. plant and soil organic matter), habitat (e.g. soil characteristics) and predation (e.g. nematodes, protozoa and viruses). However, the relative contribution of these factors on microbial community composition is poorly understood. Here, we sampled soils from 30 chalk grassland fields located in three different chalk hill ridges of Southern England, using a spatially explicit sampling scheme. We assessed microbial communities via phospholipid fatty acid (PLFA) analyses and PCR-denaturing gradient gel electrophoresis (DGGE) and measured soil characteristics, as well as nematode and plant community composition. The relative influences of space, soil, vegetation and nematodes on soil microorganisms were contrasted using variation partitioning and path analysis. Results indicate that soil characteristics and plant community composition, representing habitat and resources, shape soil microbial community composition, whereas the influence of nematodes, a potential predation factor, appears to be relatively small. Spatial variation in microbial community structure was detected at broad (between fields) and fine (within fields) scales, suggesting that microbial communities exhibit biogeographic patterns at different scales. Although our analysis included several relevant explanatory data sets, a large part of the variation in microbial communities remained unexplained (up to 92% in some analyses). However, in several analyses, significant parts of the variation in microbial community structure could be explained. The results of this study contribute to our understanding of the relative importance of different environmental and spatial factors in driving the composition of soil-borne microbial communities. © 2009 Society for Applied Microbiology and Blackwell Publishing Ltd.