Abstract The Pyrenean desman (Galemys pyrenaicus) is an endangered, semi‐aquatic, insectivore mammal, endemic to the northern Iberian Peninsula and the Pyrenees. Owing to its small populations, evasive behaviour, and nocturnal activity, knowledge of its ecological requirements is still limited. Continuing population decline over most of its distribution range – even in regions where water quality has clearly improved – points to other factors as the main conservation threat. Nevertheless, at present there is a lack of information on its habitat preferences within its area of occupancy (e.g. stream microhabitat characteristics), a key point for assessing or improving its habitat. This study used radio‐telemetry data to determine the use of space at microhabitat level by the desman, and how this changed depending upon environmental conditions. Desmans were studied in two contrasting rivers in the Basque Country (northern Iberian Peninsula): Elama, a nearly pristine stream, and the Leitzaran, a clean‐water stream affected by hydropower diversions. Fifteen desmans were captured and radio‐tracked in Elama and 16 were captured and radio‐tracked in the Leitzaran, and nocturnal activity points were assigned to one of three habitat types: riffles, runs, or pools. Habitat use was compared against availability to measure habitat selection in each stream and between streams. Desmans selected riffles positively and pools negatively, with this selection being stronger in the Leitzaran. The results highlight the ecological relevance of riffles as foraging habitats of desmans, and therefore as key features for their conservation. It suggests that channel modifications that reduce the areal cover of riffles impair habitat quality for this species. In addition, water diversion for hydropower is likely to be detrimental for desmans, as it reduces discharge and flow velocity in the bypassed river sections.