Battle of Alcácer Quibir
Portugal and Spain passed an agreement in 1496 in which they effectively established their zones of influence on the North African coast. As a result, Spain could only occupy territory east of Peñón de Vélez. This restriction ended with the Iberian Union of Portugal and Spain under Felipe II after the 1578 Battle of Alcácer Quibir, when Spain started to take direct actions in Morocco, as in the occupation of Larache.