Moulouya River
The rest of Moulay Ismail's reign was marked by military setbacks and family problems relating to the succession. In May 1692, Moulay Ismail sent his son Moulay Zeydan with a large army to attack Ottoman Algeria. He was defeated by the Ottomans who counter-attacked and advanced as far as Fez. Ismail offered his submission to the dey of Algiers and had to send an embassy to Algiers to make peace. He thus fixed his borders with the kingdom of Algiers at the Moulouya River. In 1693, Moulay Ismail raided the Oran region and attempted to pillage the Beni Amer which was successful. The city of Oran resisted two attacks, leading to the sultan's retreat. This time, it was the Turks who sent envoys to make peace, at the initiative of the Ottoman Sultan, Ahmed II. In 1699, Moulay Ismail participated in the Maghrebi War and was successful in capturing the Beylik of Mascara and advanced with about 50,000 men as far as the Chelif River but his army was routed by the Algerians at the Battle of Chelif in 1701. Ismail, wounded in the fighting, had to escape on horseback and narrowly escaped capture. Moulay Ismail fought other minor conflicts with the Ottoman Algeria such as Laghouat in 1708 which turned out successful.