 The fortress was likely built over the ruins of the ancient city of Oba which dated to pre Roman Celtiberian period.Given its strategic location on the frontier of the Gibraltar region, this fortress proved an important Moorish stronghold throughout the Muslim domination of the Iberian Peninsula.The castle was taken by the Jerezanos in 1430 and retaken by the Moorish Kingdom of Granada in 1451.