AbstractThe effect of habitat loss on the decline of habitat specialists has been well documented in coral reef fishes, since they have a restricted habitat preference. However, the different competitive advantages of specialists and generalists can impact their performance within varying habitat conditions. The order in which species arrive into a community influences competitive outcomes; these ‘priority effects’ may modify communities within degrading resource scenarios as individuals migrate in search of higher quality resources. In this study, we investigated: how sequence and timing of arrival affects interactions between a habitat generalist and a specialist in healthy and degrading environments, and how prior residency interacts with habitat quality and species identity to affect propensity to migrate. We conducted manipulative field studies using the damselfishes Pomacentrus amboinensis, a habitat generalist, and Pomacentrus moluccensis, a live coral specialist, on live or dead coral habitats, with timing of arrival differing between early and late arrivers (residents and intruders, respectively) by 1, 3 or 24 h. Our results demonstrated that the strength of priority effects (i.e., aggression intensity) increased with increasing timing of arrival when the P. moluccensis arrived after P. amboinensis, suggesting that as the perceived value of the habitat patch increased (owing to increasing ownership duration and defence investment), the tendency to defend it increased. Propensity to migrate from dead to live coral was greater for P. moluccensis compared to P. amboinensis; however, arriving after P. amboinensis significantly reduced willingness to migrate to its preferred live coral habitat, indicating an inhibitory priority effect, directly affecting future persistence. The degree that ecological versatility and priority effects combine to modify competitive outcomes in coral reef fishes has important consequences for the persistence of specialist species in the face of environmental degradation, and has implications for predicting how our changing environment will affect fish communities.