The effects of habitat loss and fragmentation on the genetic structure and variability of wild populations have received wide empirical support and theoretical formalization. By contrast, the effects of habitat quality seem largely underinvestigated, partly due to technical difficulties in properly assessing habitat quality. In this study, we combine geographic information system (GIS)-based habitat-quality modelling with a landscape genetics approach based on mitochondrial DNA markers to evaluate the possible influence of habitat quality on the levels and distribution of genetic diversity in a range of natural populations (n = 15) of Otis tarda throughout Spain. Ninety-three percent of the population represented by our countrywide sample lives in good-quality habitats, while 4.5% and 2.5% occur respectively in intermediate and poor habitats. Habitat quality was highly correlated with patch size, population size and population density, indicating the reliability and predictive power of the habitat suitability model. Genetic diversity was significantly correlated with habitat quality, size and density of the population, but not with patch size. Three of a total of 20 existing matrilineages from the species' current genetic pool are restricted to poorquality habitats. This study therefore highlights the importance of considering both population genetics and habitat quality in a species of high conservation priority.