Barbary macaques live wild in the mountains of Morocco and Algeria, with a small, famous population on the Rock of Gibraltar. They are the only macaque species found in Africa and the only non-human primate living wild in Europe. Their range spans elevations from sea level up to 2,600 meters, though the vast majority live in high-altitude cedar forests.
Morocco: The Population Stronghold
Morocco is home to the largest concentration of wild Barbary macaques. Around 65% of the species’ total population lives in the high mixed cedar forests of the Middle Atlas Mountains, a central mountain range that runs northeast to southwest through the country. These forests, dominated by Atlas cedar and holm oak, provide the food and shelter the macaques depend on year-round. Pure holm oak forests at lower elevations also support smaller groups.
The Middle Atlas is where you’ll find the densest populations, with troops scattered across national parks and forest reserves. But the cedar forests here have been shrinking for decades. Logging, livestock overgrazing (which destroys young trees before they can grow), firewood collection, and recurring drought have all fragmented what was once more continuous habitat. On top of that, poachers capture infant macaques to sell as pets, a trade that remains one of the two biggest drivers of population decline alongside habitat loss.
Algeria: Small, Isolated Pockets
In Algeria, Barbary macaques survive in seven small, isolated pockets within the Grande Kabylie and Petite Kabylie mountain ranges in the northeast of the country. These populations are severely restricted in space and generally found in remote, hard-to-reach areas. The habitats here are more varied than in Morocco: mixed cedar and holm oak forests, humid stands of Portuguese and cork oak, and rocky gorges covered in scrub vegetation.
Despite the fragmented nature of these populations, recent reviews suggest Algeria may host over 9,000 individuals, a larger share of the global population than previously assumed. Early estimates from the 1980s placed the total wild population across all of North Africa at roughly 22,000. While the Algerian numbers represent a meaningful proportion, the isolation of each pocket makes these groups vulnerable. If one local population disappears, there’s no easy way for macaques from other areas to recolonize.
Gibraltar: Europe’s Only Wild Primates
The roughly 300 Barbary macaques living on the Rock of Gibraltar are Europe’s only wild primate population outside of humans. They’re a major tourist attraction, but they aren’t truly “wild” in the same sense as their North African relatives. The population is actively managed by the Gibraltar Ornithological and Natural History Society and the Gibraltar Veterinary Clinic under agreements with the government.
The first written record of macaques on Gibraltar dates to 1704, and there has long been debate about how they got there. Some authors speculated they could be remnants of an ancient European population, since Barbary macaques once ranged across southern Europe during warmer periods tens of thousands of years ago. Genetic analysis has largely settled this question. All the mitochondrial DNA types found in Gibraltarian macaques also exist in North African populations, and there’s no fossil evidence of the species surviving in Gibraltar after the last ice age. The current colony most likely descends from animals imported from North Africa, with a key group brought in during World War II.
Feeding the macaques is illegal in Gibraltar, carrying a £500 fine. Human food disrupts their diet and can cause health problems like diabetes.
How They Handle Mountain Winters
Living at high altitudes means Barbary macaques regularly face snow, freezing rain, and sub-zero temperatures. They’ve developed a set of behavioral strategies to cope. One of the most important is careful selection of where they sleep. Troops choose sleeping sites in sheltered valley bottoms rather than exposed hillsides, in areas with dense stands of cedar trees that block wind and trap warmer air. They sleep exclusively in Atlas cedars, preferring large trees with many upper branches. Those thick, layered branches catch falling snow before it reaches the animals, reduce heat radiating away to the cold night sky, and provide sturdy platforms for the macaques’ key cold-weather tactic: huddling.
Social huddling is a form of group thermoregulation. By pressing together on a branch, macaques reduce the amount of body surface exposed to cold air. Larger trees with stronger branches allow bigger huddles, which provide more warmth. Coniferous forests like cedar groves also maintain higher overnight air temperatures than other forest types, giving the macaques a measurable energy advantage just by being in the right kind of forest.
Why Their Range Keeps Shrinking
Barbary macaques once occupied a much broader range across North Africa. Even within the 20th century, some areas that previously supported populations became unoccupied within just 15 years. The species is classified as endangered, and the pressures are ongoing and largely human-driven.
In Morocco, the cedar forests of the Middle Atlas are the critical battleground. Livestock, particularly goats and sheep, eat seedlings and young trees, preventing the forest from regenerating. Local communities depend on these forests for firewood and animal fodder, creating a cycle of degradation. Drought, intensified by climate change, weakens and kills mature cedars, compounding the damage. In Algeria, the extreme fragmentation of remaining habitat means even small disturbances can wipe out an entire local population.
The illegal pet trade compounds these problems. Young macaques are captured and sold, often across international borders, removing individuals from already small and stressed populations. Together, habitat loss and the pet trade represent the two most significant threats to the species’ survival in the wild.

