ABSTRACTAimHabitat destruction causes “extinction debt” and is also thought to produce ecosystem function debt, but theory of their magnitude and nature is limited. Heterogeneous landscapes are fundamental to the maintenance of species richness and ecosystem function, while directed or undirected dispersal behaviour, such as dispersal of seeds by animals or by the wind, is also important, especially after habitat destruction. We therefore consider extinction and ecosystem function debt under different dispersal rates and behaviours in heterogeneous landscapes.MethodsWe use a classic heterogeneous metacommunity model to capture the dynamics of competing species in local patches linked by dispersal and varying in environmental conditions. We remove one patch at a time and measure extinction debt and ecosystem function debt by the number/proportion of delayed extinctions and the amount of biomass change, respectively.ResultsWe reveal three species extinction regimes as dispersal increases: (1). species most adapted to the removed habitat are most at risk; (2). similarly adapted species are also at risk; (3). patch removal shifts competitive balance among the few species coexisting at high dispersal, where competition is strong. We find surprisingly that destruction of habitat can hasten the extinction of those species best adapted to harsh environments and that the proportion of diversity at risk from extinction actually increases with dispersal because competition is intense there. Finally, there can be a small ecosystem credit but extinction debt when dispersers reroute to potentially more favourable remaining habitats (directed dispersal), especially when harsh environments are removed. However, ecosystem debt occurs and can be large under undirected dispersal.Main ConclusionsThe magnitude and nature of extinction and ecosystem function debts depend on species dispersal rates and behaviours, as well as the environmental conditions of the disturbed habitats. Conservation actions will be more successful if they consider these factors.