Small species with high home fidelity, high ecological specialization or low vagility are particularly prone to suffer from habitat modification and fragmentation. The Lima leaf-toed gecko (Phyllodactylus sentosus) is a critically endangered Peruvian species that shelters mostly in pre-Incan archeological areas called huacas, where the original environmental conditions are maintained. We used genotyping by sequencing to understand the population genomic history of P. sentosus. We found low genetic diversity (He 0.0406–0.134 and nucleotide diversity 0.0812–0.145) and deviations of the observed heterozygosity relative to the expected heterozygosity in some populations (Fis − 0.0202 to 0.0187). In all analyses, a clear population structuring was observed that cannot be explained by isolation by distance alone. Also, low levels of historical gene flow were observed between most populations, which decreased as shown in contemporary migration rate analysis. Demographic inference suggests these populations experienced bottleneck events during the last 5 ka. These results indicate that habitat modification since pre-Incan civilizations severely affected these populations, which currently face even more drastic urbanization threats. Finally, our predictions show that this species could become extinct in a decade without further intervention, which calls for urgent conservation actions being undertaken.