By end of the 16th century Cassel had become a border town between France and the Spanish Netherlands. The French repeatedly fought with Spain and later the independent Dutch Republic for control of the town; in March 1645, Gaston, Duke of Orléans seized it but lost it again to the Spanish a few months later. In 1658 Turenne expelled two Irish regiments in the pay of the Spanish who were garrisoning Cassel. The French captured the town in July 1676 under Louis de Crevant, Duke of Humières and strengthened the castle. The following year, a third Battle of Cassel took place just west of the town on 11 April 1677 when a French army under François-Henri de Montmorency, duc de Luxembourg and Philippe I of Orléans defeated Dutch forces commanded by William III of England. The battle took place after King Louis XIV of France besieged the Dutch-held town of Saint-Omer during the Franco–Dutch War. William sent an army to relieve Saint-Omer but was defeated at the village of Zuytpeene just to the west of Cassel, losing 7-8,000 men killed or wounded and another 4,000 taken prisoner. Saint-Omer fell a week later.