France entered the Thirty Years' War after the Spanish 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 in response aides the Fronde revolt in France in 1648. During the negotiations for the Peace of Westphalia in 1648, France gained Alsace and Lorraine and cut off Spanish access to the Netherlands from Austria, leading to open warfare between the French and Spanish.
After over 10 years of war, an Anglo-French alliance was victorious at the Battle of the Dunes in 1658 and a peace was settled in 1659. France gained Roussillon, Artois, Luxembourg, and Flanders, and the border with Spain was fixed at the Pyrenees. The treaty also arranged for a marriage between Louis XIV of France and Maria Theresa of Austria, the daughter of Philip IV of Spain. Maria Theresa was forced to renounce her claim to the Spanish throne, in return for a monetary settlement as part of her dowry. This settlement was never paid, a factor that led to the War of the Spanish Succession in 1702.
The defeat and inability to pay Maria Theresa's dowry effectively eliminated Spain as an important power in Europe, while France as a result was at the height of its power.