Early man took a great interest in the area thanks to its abundant water, fertile hunting grounds and caves. Cueva de Hundidero ('fallen', a reference to falls in the rock roof), which is popular with today's potholers, was inhabited during the Stone Age. Located near by is 'El Gigante', a dolmen from the Neolithic period. The Romans seem to have left this high valley alone, although a sophisticated rural economy existed during the classical period only 7km to the north.
The Berbers first took an economic interest in this marginal zone and built the original community. Hidden from the valley floors, it became the local seat of power and a discrete communications centre. Its place name has been interpreted as Monte-Xaquez, or the lost mountain. The 'hidden pueblo' would be a more appropriate name, though this name is obviously a later Christian corruption. A castle and mosque indeed existed to serve Montejaque and roads led over the mountains to Ronda and Grazalema.
After the Christian conquest in 1485, the various censuses give us a clue of its importance during the Moorish period. The 1492 census recorded a population of 350, one of the largest in the area except Ronda. It was large enough to have been made seat of its own Senorio de Montejaque, granted to the Conde de Benavente. Its domain also included Benaojan and the deserted medieval village of Ocegina. With such a large population for this region it was made a parish in 1505, founded with one benefactor and one sacrament.
The inquisition paid a visit to the pueblo in 1560 and found three victims, who were still practising Moorish customs and dress. How much upheaval this really caused is not known but it must have contributed to the uprisings in 1570. Though the revolt seemed to bypass this immediate area, the population must have been affected by the expulsion of the Morisco population.
Even though the pueblo saw an adjustment in its population, it grew steadily in the 18th century. Town space became a premium and the castle would have been absorbed around this time. By 1910 the census recorded 2,080 inhabitants and although a drop was experienced soon after this due to emigration, its numbers peaked again in 1950.
The townsmen were heavily involved during the Civil War until the Nationalists broke through from Cadiz in 1937. In advance of the Nationalist and Italian troops, the loyalists fled into the mountains in the direction of Grazalema, east of the pueblo. They took refuge in a large fertile bowl surrounded by mountains, today known as the Valley of the Republicans. The Republicans held out for many years in the name of the cause, making daring guerrilla attacks on the Guardia Civil and Franco's authority. However, by the early 1940s they had become little more than a group of criminal bandits whose cause was lost. Legend today keeps alive their heroic last stand and the defiance that in some corners continued until Franco's death in 1975. There are no bandits in the hills now.