How populations of aquatic fauna persist in extreme desert environments is an enigma. Individuals often breed and disperse during favourable conditions. However, theory predicts that adaptive capacity should be low in small populations, such as in desert fishes. We integrated satellite-derived surface water data, neutral population dynamics and adaptive evolution to understand metapopulation persistence across the range of the desert rainbowfish, central Australia. Desert rainbowfish showed very small population sizes, especially at peripheral populations, and low connectivity between river catchments. Yet, there was no evidence of population-level inbreeding and there was adaptive divergence associated with aridity. Candidate adaptive genes included functions related to environmental cues and stressful conditions. Evolutionary modelling showed that selection in refugial sub-populations combined with connectivity during flood periods can enable retention of adaptive diversity. Our study demonstrates that adaptive evolution can occur in small populations and integrate with neutral metapopulation processes to allow persistence in the desert.