Increased fragmentation caused by habitat loss represents a major threat to the persistence of animal populations. How fragmentation affects populations depends on the rate at which individuals move between spatially separated patches. Whereas negative effects of habitat loss on biodiversity are well known, the effects of fragmentation
per se
on population dynamics and ecosystem stability remain less well understood. Here, we use a spatially explicit predator–prey model to investigate how the interplay between fragmentation and optimal foraging behaviour affects predator–prey interactions and, subsequently, ecosystem stability. We study systems wherein prey occupies isolated patches and are consumed by predators that disperse following Lévy random walks. Our results show that the Lévy exponent and the degree of fragmentation jointly determine coexistence probabilities. In highly fragmented landscapes, Brownian and ballistic predators go extinct and only scale-free predators can coexist with prey. Furthermore, our results confirm that predation causes irreversible habitat loss in fragmented landscapes owing to overexploitation of smaller patches of prey. Moreover, we show that predator dispersal can reduce, but not prevent or minimize, the amount of lost habitat. Our results suggest that integrating optimal foraging theory into population and landscape ecology is crucial to assessing the impact of fragmentation on biodiversity and ecosystem stability.