It is located in the northwest of the Malaga province, in the foothills of the Penibetica mountain range, known as Mesas de Villaverde, on the southern slopes of the Sierra de Abdalajís mountain.
Of Roman origin, the first transformations in the Bobastro Castle took place in 880 by Omar, Islamised goth and descendent of Count Altfuns, who took refuge in the Roman ruins after his exile in Africa after revolting against the Moors. He took the castle as the capital of the kingdom that was founded in southern Andalusia, setting up numerous companies and becoming one of the most outstanding examples of all the Andalusian region.
Following his death, his children Chafar, Soleiman and Hafs took over his reign in the 9th century. It was later conquered in 928 by Abd ar-Rahman III, who had built numerous fortresses and tower in the surrounding area to tighten the noose around the square and castle, with the fortress being demolished shortly after.