Understanding how natural selection generates and maintains adaptive genetic diversity in heterogeneous environments is key to predicting the evolutionary response of populations to rapid environmental change. Detecting selection in complex spatial environments remains challenging, especially for threatened species where the effects of strong genetic drift may overwhelm signatures of selection. We carried out a basinwide riverscape genomic analysis in the threatened southern pygmy perch (Nannoperca australis), an ecological specialist with low dispersal potential. High-resolution environmental data and 5162 high-quality filtered SNPs were used to clarify spatial population structure and to assess footprints of selection associated with a steep hydroclimatic gradient and with human disturbance across the naturally and anthropogenically fragmented Murray-Darling Basin (Australia). Our approach included FST outlier tests to define neutral loci, and a combination of spatially explicit genotype-environment association analyses to identify candidate adaptive loci while controlling for the effects of landscape structure and shared population history. We found low levels of genetic diversity and strong neutral population structure consistent with expectations based on spatial stream hierarchy and life history. In contrast, variables related to precipitation and temperature appeared as the most important environmental surrogates for putatively adaptive genetic variation at both regional and local scales. Human disturbance also influenced the variation in candidate loci for adaptation, but only at a local scale. Our study contributes to understanding of adaptive evolution along naturally and anthropogenically fragmented ecosystems. It also offers a tangible example of the potential contributions of landscape genomics for informing in situ and ex situ conservation management of biodiversity.