Despite being an interior village, as the municipality has no outlet to the sea, Ojen is included in the Western Costa del Sol. This is due not so much to its proximity to Marbella and Mijas, which it borders, as to the fact that it has almost the same climate and services as the most cosmopolitan area of Malaga. It is just a little farther away (10 kilometres), and thus comfortably insulated from the hustle and bustle of the coast.
The municipality of Ojen lies between the Sierra Blanca and Sierra Alpujata ranges on the north and stretches southward through the valleys of the Rivers Real and Ojen between steep slopes and seasonal watercourses, features that form a sometimes spectacular terrain of remarkable contrasts. In the midst of these rugged surroundings the village unexpectedly appears, surrounded by countless orchards and market gardens that descend like a stairway to the valley floor.
Judging from the remains that have been found in the Pecho Redondo cave, the first human settlements in this area date from the Neolithic period. There seems to have been a permanent population devoted to agriculture and livestock husbandry during the Late Roman Empire. After this activity-and it is only a logical presumption that it existed-history is silent about this place until the arrival of the Arabs. It was during that era that the locality was referred to for the first time, in the ‚Cronica de las Hazañas de los Emires Cordobeses‘ (Chronicle of the Feats of the Cordoban Emirs) when Abderraman III decided to put an end to the rebellion of the famous Muladi, Omar Ben Hafsun, whom he confronted before the walls of Ojen castle.
In the year 921, with the Muladi chieftain defeated, Abderraman conquered Ojen and turned its church into a mosque, an act that preceded and was similar to the later Christian custom of building churches over former mosques. During the Arabic domination, the locality was called Hoxan, which is usually translated as ‚rugged place.‘ En 1485 the Muslim population capitulated to the advancing Catholic Monarchs, who at the time prohibited the presence of Muslims less than a league from the coast in an effort to thus prevent Arab collaboration with Turkish and Berber pirates. Many residents of Marbella therefore moved to Ojen.
Relations between Muslims and Christians grew constantly more strained. The Moorish rebellion broke out in Istán in 1568 and a year later, the Moors of Ojén joined it. They fled to the mountains, but not before setting fire to the church, houses, and crops and killing their Christian neighbours. Felipe II put the Duke of Medina Sidonia in charge of putting down the rebellion in the Ronda highlands, and in 1570, Ojén was repopulated by Old Christians. In 1807, Carlos IV granted Ojén independence from the jurisdiction of Marbella.