The Barbary macaque Macaca sylvanus is imperiled throughout its distribution range in north-west Africa. In the summers of 2009 and 2013 we used the piecewise line-transect distance sampling method to study the southernmost population in the High Ourika valley, in the western High Atlas of Morocco. This rugged mountainous area is dominated by degraded fruit-poor environments, mostly holm oak Quercus rotundifolia forest patches. We located four and two groups in 2009 and 2013, respectively, and estimated population sizes of 122 and 84 individuals. The mean group size was 12 individuals in 2009 and 46 in 2013. The estimated mean density (individuals per km2) varied among groups (10–171), with a mean of 27. The population structure varied significantly among groups and years. Our records comprised 24.8 and 20% adult males, 24.8 and 22% adult females, 11 and 13% subadults, 13 and 17% juveniles and 26.4 and 26.3% infants in 2009 and 2013, respectively. In both years 50–56% of the population consisted of young individuals (subadults excluded). The mean sex ratio among adults was 1 : 1. The apparent fecundity rate was 1.06 infants per adult female. We propose conservation actions to protect this peripheral population of Barbary macaques.