the role of deterministic and stochastic mechanisms in community assembly is a key question in ecology, but little is known about their relative contribution in dung beetle assemblages. Moreover, in human modified landscapes these mechanisms are crucial to understand how biodiversity can be maintained in productive agroecosystems. We explored the assembly mechanisms driving dung beetle assemblages in forests and grazed grassland patches, and assessed the role of dung availability, soil hardness and moisture, elevation and land use heterogeneity as environmental predictors of functional diversity. to determine the underlying assembly mechanisms, we estimated functional diversity metrics (functional richness, evenness and divergence) and their departure from the predicted values by null models. We also used GLMs to assess the influence of environmental variables on functional diversity. in most cases, stochastic processes prevailed in structuring dung beetle assemblages and, consequently, environmental variables were not good predictors of dung beetle functional diversity. However, limiting similarity was found as a secondary mechanism with an effect on dung beetle assemblages in grasslands. Our results highlight the importance of stochastic processes that may reflect a metacommunity dynamic. therefore, restoring landscape connectivity might be more important than habitat quality for the conservation of these functionally diverse beetle assemblages. Community assembly theory provides a conceptual foundation about the mechanisms that determine species composition of local assemblages 1,2 , and this background becomes especially relevant for studies concerning the ecological consequences of environmental contemporary changes. For example, results from a recent study have made it possible to improve our understanding of biological invasions, a global issue that is critical in ecology and conservation 3. However, an important remaining issue is to unravel how current anthropogenic changes to the environment, such as land use change and agricultural production can modify the assembly mechanisms that shape the structure and composition of local communities 4. Human activities have contributed substantially to the loss of species and degradation of ecosystems 5,6 , generating impacts on ecological communities 7. Therefore, identifying the drivers of community assembly in human modified landscapes is an urgent challenge. Both deterministic and stochastic mechanisms are important in assembling biological communities. The main deterministic mechanisms driving community assembly are limiting similarity and environmental filtering 8-10. If the local community is formed by non-redundant species, its trait diversity will be high (trait overdispersion) as a result of strong ecological interactions, and community assembly is considered to be driven by a limiting similarity mechanism due to competition 8. On the contrary, the environmental filtering mechanism (the abiotic filter) structures local communities through environmental r...