In 1659 , Louis XIV and the Philip IV of Spain signed the Treaty of the Pyrenees . The French king also married the Infanta Marie Therese . In 1659 , Louis XIV and the Philip IV of Spain signed the Treaty of the Pyrenees , sealed with the marriage of the Infanta Marie Therese to the French King .