We used the conceptual framework of the theory of natural selection to study breeding habitat preferences by an opportunistic avian predator, the black kite Milvus migrans. In Europe, black kite populations are mostly found near large networks of aquatic habitats, usually considered optimal for foraging and breeding. We hypothesized that proximity to wetlands could vary among individuals and affect their fitness, and thus be subject to natural selection. We tested the hypothesis first on a population on Lake Lugano (Italian pre-Alps) which has been monitored for nine years, and then on seven other populations, each studied for four–five years, located along a continuum of habitat from large water bodies to scarce aquatic habitat of any kind. In the Lake Lugano population, black kite abundance was negatively related to distance to the lake in all the nine years of study, consistent with long-term natural selection. There was evidence of ongoing directional selection on strategic nest location in three of the years, and evidence of stabilizing selection in two years. In eight of the nine years the trend was for a linear increase in fitness with increasing proximity to the lake. At the population level, results were consistent with adaptive habitat choice in relation to the previous year's spatial variation in fitness: higher associations between fitness and distance to the lake (i.e. higher selection gradients) resulted in higher density variations in the following year, in turn related to the availability of fish, the main local prey. The progressive decline of inland pairs and increase in the density of lakeshore pairs caused a directional long-term trend of declining mean distance to the lake. Breeding near aquatic habitats was associated with higher foraging success, and higher frequency and biomass of prey deliveries to offspring. There was weak evidence of selection in other populations. The inland-wetland gradient of habitat quality may have been affected by predation risk, as estimated by density of a major predator of adults and nestlings, the eagle owl Bubo bubo. Behavioral decisions at the level of the individual probably translated into population effects on density and distribution at various spatial scales. Populations in optimal habitats showed higher density and produced six times as many young per unit space as those in sub-optimal habitats.