According to the associational resistance hypothesis, diverse habitats provide better resistance to biological invasions than monocultures. Host-plant abundance has been shown to affect the range expansion of invasive pests, but the effect of landscape diversity (i.e. density of host/non-host patches and diversity of forest habitat patches) on invasions remains largely untested. We used boundary displacement models and boosted regression tree analyses to investigate the effects of landscape diversity on the invasion of Corsica by the maritime pine bast scale Matsucoccus feytaudi over an 18-yr period. Taking the passive wind dispersal of the scale into account, we showed that open habitats and connectivity between host patches accelerated spread by up to 13%, whereas landscapes with high tree diversity and a high density of non-host trees decreased scale spread by up to 14%. We suggest a new mechanism for such associational resistance to pest invasion at the landscape level, which we term ‘the pitfall effect’.