We studied spatial variation of macroinvertebrate species richness in headwater streams at two spatial extents, within and across drainage systems, and assessed the relative importance of three groups of variables (local, landscape and regional) at each extent. We specifically asked whether the same variables proposed to control broad-scale richness patterns of terrestrial organisms (temperature, topographic variability) are important determinants of species richness also in streams, or whether environmental factors effective at mainly local scales (in-stream heterogeneity, potential productivity) constrain species richness in local communities. We used forward selection with two stopping criteria to identify the key environmental and spatial variables at each study extent. Eigenvector-based spatial filtering was applied to evaluate spatial patterns in species richness, and variation partitioning was used to assess the amount of variation in richness attributable to purely environmental and spatial components. A prime regulator of richness variation at the bioregion extent was elevation range (increasing richness with higher topographic variability), whereas hydrological stability and temperature were unimportant. Water chemistry variables, particularly water color, exhibited strong spatially-structured variation across drainage systems. Local environmental variables explained most of the variation in species richness at the drainage-system extent, reflecting gradients in total phosphorus and water color (negative effect on richness). The importance of the pure spatial component was strongly region-dependent, with a peak (60%) in one drainage system, suggesting the presence of unmeasured environmental factors. Our results emphasize the need for spatially-explicit, regional studies to better understand geographical variation of freshwater biodiversity. Future studies need to relate species richness not only to local factors but also to broad-scale climatic variables, recognizing the presence of spatially-structured environmental variation.