Sidi al-Ayachi

Sidi M'Hamed al-Ayachi (محمد بن أحمد المالكي الزياني العياشي; ), also el-Ayachi or al-Ayashi ( – 1641), was a Moroccan marabout, warlord, and jihadist. The Sultan of Morocco, Mulay Zidan al-Nasir, had made him governor (qā′id) of Azmūr, but in 1627 he decided to secede and created his own state.

Since the death of Ahmad al-Mansur in 1603, Morocco had progressively fallen into a state of anarchy due to his sons fighting for the thrones, it caused a loss of central authority beheld by the Sultan. With Morocco in a state of civil war, in 1610 to reinforce his power, Mohammed esh Sheikh el Mamun conceded to the Spanish the city of Larache and pledged of their alliance. However, they also seized the opportunity to capture al-Ma'mura in 1614. The Sultan's seeming inability to defend the country, infuriated Sidi al-Ayachi, and he began a counter-offensive against Spain, privateering against its shipping, and obtaining the help of the Moriscos and the English. He managed to re-capture al-Mamura, albeit temporarily, and extended his power as far as Taza.

In April 1627, Sidi al-Ayachi revolted against the sultan and attacked the harbour of Salé, which he captured and transformed into his own principality, the Republic of Bou Regreg, becoming its independent governor. The English diplomat John Harrison negotiated a treaty with Sidi al-Ayachi in May 1627, a month later. The Dutch also strongly supported Sidi al-Ayachi, and supplied him with arms.

It was not until Sultan Mohammed esh Sheikh es Seghir came to the throne in 1636, that real efforts were made to restore Sidi al-Ayachi to the throne and of his territories. Sidi al-Ayachi was killed in battle in 1641.