France entered the Thirty Years' War after the Spanish Habsburg victories in the Dutch Revolt in the 1620s and at the Battle of Nördlingen against Sweden in 1634. By 1640, France began to interfere in Spanish politics, aiding the revolt in Catalonia, while Spain responded by aiding the Fronde revolt in France in 1648. During the negotiations for the Peace of Westphalia in 1648, France gained the Sundgau and cut off Spanish access to the Netherlands from Austria, leading to open warfare between the French and Spanish.
After 23 years of war, an Anglo-French alliance was victorious at the Battle of the Dunes in June 14, 1658, but the following year the war ground to a halt when the French campaign to take Milan was defeated. Peace was settled by means of the Treaty of the Pyrenees in November 1659.