Studies on fertility determinants have frequently pointed to the role that socio-economic, cultural and institutional factors play in shaping reproductive behaviours. Yet, little is known about these determinants at an ecological level, although it is widely recognised that demographic dynamics strongly interact with ecosystems. This research responds to the need to enhance the knowledge on variations in fertility across space with an analysis of the relationship between fertility and population density of Italians and foreigners in Italy at the municipal level for the period 2002–2018. Using global and local autocorrelation measures and a spatial Durbin model, we show that there is a negative association between the fertility and population density of the Italian population, while the density of foreigners is correlated with higher fertility. This second result poses new insights on the relationship between space and fertility. Moreover, we find that the features of neighbouring areas, measured by population density, contribute significantly to explaining spatial fertility variation, confirming the importance of the study of spatial diffusion in demographic processes.