The castle was built in 929AD by Abd-al-Rahman III, Caliph of Cordoba, on a former Phoenician enclosure and lighthouse, from which its name was derived – gebel-faro (Arabic and Greek, meaning rock of the lighthouse). Yusef 1, Sultan of Granada, enlarged it at the beginning of the 14th century, also adding the double wall down to the Alcazaba.
The castle is famous for its three-month siege by the Catholic monarchs, Ferdinand and Isabella, which ended only when hunger forced the Malagueños to surrender. Afterwards Ferdinand occupied the site, while his queen took up residence in the town. Interesting historic fact: this was the first conflict in which gunpowder was used by both sides