Built in 960 A.C. on orders of the caliph Abderraman III, it was erected upon the ruins of a possible roman barracks.
Recent archaeological excavations prove evidence of the presence, where the castle is now located, of remains belonging to the Bronze Age, the Punic and Iberian periods as well as Roman vestiges from the initial Republican stage, Upper and Lower Empires.
After the Christian Conquest in 1292 by Sancho IV el Bravo, in 1294 the event which made Tarifa worldwide well-known occurs: the feat of Guzmán el Bueno who preferred his own son to be sacrificed to surrendering the Castle he had been entrusted with by his king.
Each and every of the above mentioned historical stages has left its mark on the town history. As a result, today its castle shows the aspect of numerous defence constructions, such as Gates, Towers, Barbican Towers and Corachas (Parapet- walked wall joining the fianking tower together with the main fortified enclosure), as well as a Palatial character gradually acquired since the 14th century and a while in possession of the Marquis of Tarifa in the 16th century.
The castle has preserved its military aspect for a millennium. In 1989 it was placed in civil hands restoring and fitting out works (to be continued in future) being undertaken to make it suitable for public visit.