Under the Portuguese, Agadir had been an important trading center between Europe and Morocco, particularly for the products of Sus.[1] Agadir later continued to develop as a trading base with Europe, receiving European cloth and wheat in exchange for gold and sugarcane.[2] At the end of the 17th century, the harbour fell under the rule of the Tazerwalt leaders, who were opposed to the Alaouites.[2] When the Alouites gained supremacy in the 18th century, they closed the harbour of Agadir, in favour of the harbour of Essaouira further north.[2]