This study of wild-living Algerian Barbary macaques (Macaca sylvanus) was designed to examine genetic variability in subpopulations isolated in residual forest patches, in an attempt to obtain data on the effects of habitat fragmentation. The wild population of this species (estimated at a maximum of 15 000) is vulnerable and this study therefore has direct relevance for conservation measures. Data from five microsatellite loci were analysed for 159 individuals from nine different groups living in four isolates in Algeria. Genetic polymorphism was found to be relatively high (4–12 alleles per locus) compared with other genetic markers used in previous studies of this species; mean expected heterozygosity was 65%. The four isolates are all genetically distinct (FST = 0; P < 0.001). Indeed, the results suggest that dispersal is limited even between some social groups within a single isolate. Genetic distances based on models not assuming stepwise mutation (FST and chord distance) gave very similar results and are highly correlated with geographical distances within one isolate but not between isolates. This may indicate that isolation by distance exerts a significant influence within an isolate but that genetic drift prevails between the four isolates. After allowing for variation in sample size, we found no evidence of reduced allelic diversity within small isolates that may have been separated for 250 years or more. The surviving population of Algerian Barbary macaques taken as a whole still shows marked variability in microsatellite alleles, but maintenance of genetic variability over the long term will surely require effective protection of all isolates.