Treaty of the Pyrenees
Again besieged and captured by the French during the Thirty Years' War in September 1642, Perpignan was formally ceded by Spain 17 years later in the Treaty of the Pyrenees, and from then on remained a French possession.