El Jadida, previously known as Mazagan (Portuguese: Mazagão), was seized in 1502 by the Portuguese. From 1580 to 1640, Portugal was under Spanish dynastic rule. Portuguese abandoned Mazagão in 1769. Many of its inhabitants were evacuated to Brazil, where they founded new settlement Nova Mazagão (now in Amapá). El Jadida was then taken over by sultan Mohammed ben Abdallah.