The Treaty of the Pyrenees was signed on 7 November 1659 to end the 1635-1659 war between France and Spain, a war that was initially a part of the wider Thirty Years' War. It was signed on Pheasant Island, a river island on the border between the two countries which has remained a French-Spanish condominium since the treaty. The kings Louis XIV of France and Philip IV of Spain were represented by their chief ministers, Cardinal Mazarin and Don Luis Méndez de Haro, respectively.

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.

More Info: en.wikipedia.org