1. 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 rangeeven in regions where water quality has clearly improvedpoints 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.2. 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. 3. 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. 4. Desmans selected riffles positively and pools negatively, with this selection being stronger in the Leitzaran. 5. 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.