Macaques are highly adaptable generalists and are thus found in the widest range of habitats.
In areas where they are considered sacred and thus left unmolested, Rhesus macaques have adapted to life in urbanised areas. These macaques are also found from semi-desert to dense forests, to mountains above the snowline. The genus includes the most northerly primate, the Japanese macaque. Similarly, the crab-eating macaque also manages to adapt to human settlements, although they prefer mangrove habitats. All macaques are found only in Asia, with the only exception of the Barbary Ape, which is found in northern Africa.