In its beginnings, it was an Arab fortress, built by the Berber tribe of the Miknasa towards the 12th century. In which at the end of several conquests, it falls into the hands of Ramon Berenguer IV, passing definitively to the hands of Christians. After several changes of owner, in 1184 the castle and the town of Mequinenza, the Marquis of Aitona, Ramón Guillén de Moncada, and later to the Dukes of Medinaceli (Duchess of Alba) are granted. But until the fifteenth century the first reforms were not introduced to convert the military fortress into residence-palace.
