Assessing genetic diversity within species is key for conservation strategies in the context of human-induced biotic changes. This is important in marine systems, where many species remain undescribed while being overfished, and conflicts between resource-users and conservation agencies are common. Combining niche modelling with population genomics can contribute to resolving those conflicts by identifying management units and understanding how past climatic cycles resulted in current patterns of genetic diversity. We addressed these issues on an undescribed but already overexploited species of sardine of the genus Harengula. We find that the species distribution is determined by salinity and depth, with a continuous distribution along the Brazilian mainland and two disconnected oceanic archipelagos. Genomic data indicate that such biogeographic barriers are associated with two divergent intraspecific lineages. Changes in habitat availability during the last glacial cycle led to different demographic histories among stocks. One coastal population experienced a 3.6-fold expansion, whereas an island-associated population contracted 3-fold, relative to the size of the ancestral population. Our results indicate that the island population should be managed separately from the coastal population, and that a Marine Protected Area covering part of the island population distribution can support the viability of this lineage.