AbstractMadagascar exhibits exceptionally high levels of biodiversity and endemism. Models to explain the diversification and distribution of species in Madagascar stress the importance of historical variability in climate conditions which may have led to the formation of geographic barriers by changing water and habitat availability. The relative importance of these models for the diversification of the various forest‐adapted taxa of Madagascar has yet to be understood. Here, we reconstructed the phylogeographic history of Gerp's mouse lemur (Microcebus gerpi) to identify relevant mechanisms and drivers of diversification in Madagascar's humid rainforests. We used restriction site associated DNA (RAD) markers and applied population genomic and coalescent‐based techniques to estimate genetic diversity, population structure, gene flow and divergence times amongM. gerpipopulations and its two sister speciesM. jollyaeandM. marohita. Genomic results were complemented with ecological niche models to better understand the relative barrier function of rivers and altitude. We show thatM. gerpidiversified during the late Pleistocene. The inferred ecological niche, patterns of gene flow and genetic differentiation inM. gerpisuggest that the potential for rivers to act as biogeographic barriers depended on both size and elevation of headwaters. Populations on opposite sides of the largest river in the area with headwaters that extend far into the highlands show particularly high genetic differentiation, whereas rivers with lower elevation headwaters have weaker barrier functions, indicated by higher migration rates and admixture. We conclude thatM. gerpilikely diversified through repeated cycles of dispersal punctuated by isolation to refugia as a result of paleoclimatic fluctuations during the Pleistocene. We argue that this diversification scenario serves as a model of diversification for other rainforest taxa that are similarly limited by geographic factors. In addition, we highlight conservation implications for this critically endangered species, which faces extreme habitat loss and fragmentation.