[17][18] The Moroccan incursions to the east of the Moulouya upstream, then Algerian territory, prompted Hadj Chabane to declare war on Sultan Moulay Ismail.
[21] These tensions at the Algerian border occurred because Moulay Ismail wanted to have his "religious equality" with the Sultan of Istanbul recognized in the eyes of the Europeans.
Léon Galibert gives the following account: It was to the king of Morocco, who sometimes came to ravage his territory, that the new dey Chaaban declared war: he went to the western border with 10,000 janissaries and 3,000 spahis.
The Sultan of Morocco, Moulay Ismail commanded it in person, but was reluctant to engage in combat knowing the earlier victory that the Algerians had spread terror among his soldiers.
[24][20][25] Moulay Ismael and the Moroccan army, terrified by this hard failure, are forced to ask for peace by granting in a treaty the sovereignty of the regency of Algiers on the territories going up to Moulouya.