After the two-year Siege of Algeciras (1342-1344), Algeciras was taken over by the Castilian forces. Therefore, Gibraltar became the main Marinid port in the Iberian Peninsula. During the siege, Gibraltar played a key role as the supply base of the besieged.