The Barbary ape (not an ape, but so called because of its lack of tail) lives in the mountains of Morocco, where it is becoming increasingly rare. Rather than an ape, it is a macaque species whose nearest family members live in Pakistan and India, the rhesus monkey; all other macaques live in Asia too so how did Macaca sylvanus get to Morocco? Moreover, the Barbary monkey also occurs in Europe, on the rock of Gibraltar. It is not known how they might have got there but a 2000 Gibraltar stamp from a Millennium issue about Gibraltar's history seems to suggest they may have come with the spread of Islam across the straits, in 711:
However, monkeys are considered unclean by Islam - others have suggested they may have come a pets with Phenician or Carthaginian ships. The species was known in antiquity but I am not aware it bing mentioned as living in Spain.
An unlikely tale suggests a tunnel below the Mediterranean...
Be that as it may, tradition has it that as long as there are monkeys on the rock, it will stay part of the UK. In WWII, numbers dropped and Churchill himself is claimed to have ordered fresh imports from Africa (if you can get it, Paul Gallico (author of "The Snow Goose")wrote an amusing tale about this - the book is called "Scruffy").
Anyway, the apes have thrived on the rock and since tourist will feed them, despite being asked not to, can be quite a nuisance. But Gibraltar is proud of its "apes", and the species features on a number of their stamps, including their own issue of 6 in 2011: