Context: The role of ecological processes governing community structure are dependent on the spatial distances among local communities and the degree of habitat heterogeneity at a given spatial scale. Also, they depend on the dispersal ability of the targeted organisms collected throughout a landscape window. Objectives: We assessed the relative importance of spatial and environmental factors shaping edaphic (Collembola) and epigeous (Carabidae) communities at different scales. Methods: The sampling sites were four different landscape windows (1 km2 square each) in a Mediterranean cork-oak landscape in Portugal. Variance partitioning methods were used to disentangle the relative effects of spatial variables and environmental variables (habitat: data on % of vegetation cover types; management: data on forestry and pasture interventions; landscape: data on landscape metrics e.g., patch size, shape and configuration) across different spatial scales. Results: The relative effects of environmental and spatial factors at different scales varied between Collembola and Carabidae. The pure effect of the environmental component was only significant for carabid beetles and explained a higher percentage of their community variance compared to collembolan communities. The pure effects of the spatial component were generally higher than the environmental component for both groups of soil fauna. Carabid communities responded to landscape features related to the patch connectivity of open areas (grasslands) as well as the shape of cork-oak habitat patches integrating the agro-forest mosaic. Conclusions: Community patterns of surface-dwelling soil fauna may be partly predicted by some features of the landscape, while soil-dwelling communities require ecological assessments at finer spatial scales.