Gradients of agricultural intensification in agroecosystems may determine uneven resource availability for predators relying on these man-made habitats. In turn, these variations in resource availability may affect predators’ habitat selection patterns, resulting in context-dependent habitat selection. We assessed the effects of gradients of landscape composition and configuration on habitat selection of a colonial farmland bird of prey, the lesser kestrel (Falco naumanni), relying on 76 GPS-tracked nestling-rearing individuals from 10 populations scattered along an agricultural intensification gradient. Analyses were conducted considering two ecological levels of aggregation (the population and the individual) and two spatial scales of habitat availability (the colony surroundings and the individual home-range). Overall, non-irrigated croplands and semi-natural grasslands were the most preferred habitats at both spatial scales. At the colony scale, lesser kestrels showed a preference for grassland compared to non-irrigated crops, whereas the opposite was the case within individual home-ranges. Conversely, croplands were positively selected with comparable intensity at both spatial scales. Strong selection for grassland at the colony scale highlights the importance of this semi-natural habitat for the species. The weaker preference for grassland at the home-range scale is likely due to the phenology and structure of the vegetation in the late breeding season. Spatial scale differences in selection patterns may thus derive from spatio-temporal changes in resource availability through the breeding season. The strength of selection for the two most used habitats varied markedly among individuals. At the spatial scale of the colony, individual selection strength for grasslands increased with decreasing compositional diversity of the surrounding landscape, suggesting that agroecosystem heterogeneity may at least partly buffer the loss of semi-natural habitats. At the within home-range scale, higher cropland availability reduced the strength of individual preference for this habitat, suggesting a negative functional response possibly related to density-dependent processes acting on foraging movements. Our study provides evidence that farmland species show context-dependent habitat selection patterns in response to landscape gradients shaped by agricultural intensification as well as by intrinsic characteristics and habitat availability. Our findings highlight the importance of addressing both individual and population-level variability and considering multiple spatial scales in studies of habitat selection to inform species’ management and conservation.