The role of environmental transmission of typically foodborne pathogens like Shiga toxin-producing (STEC) O157 is increasingly recognized. To gain more insights, we assessed the spatial association between sporadic STEC O157 human infections and the exposure to livestock (i.e. small ruminants, cattle, poultry, and pigs) in a densely populated country: the Netherlands. This was done for the years 2007-2016, using a state-of-the-art spatial analysis method in which hexagonal areas with different sizes (90, 50, 25 and 10 km2) were used in combination with a novel probability of exposure metric: the population-weighted number of animals per hexagon. To identify risk factors for STEC O157 infections and their population attributable fraction (PAF), a spatial regression model was fitted using integrated nested Laplace approximation (INLA). Living in hexagonal areas of 25, 50 and 90 km2 with twice as much population-weighted small ruminants was associated with an increase of the incidence rate of human STEC O157 infections in summer (RR of 1.09 [95%CI;1.01-1.17], RR of 1.17 [95%CI;1.07-1.28] and RR of 1.13 [95%CI;1.01-1.26]), with a PAF of 49% (95%CI;8-72%). Results indicate a potential transmission of STEC O157 from small ruminants to humans via the environment. However, the underlying mechanisms warrant further investigation and could offer new targets for control. Furthermore, the newly proposed exposure metric has potential to improve existing spatial modelling studies on infectious diseases related to livestock exposure, especially in densely populated countries like the Netherlands.