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. The treaty changed the borders. It gave Rousillon to France and moved the frontier south to the crest of the Pyrenees, where it is now. The fortresses therefore lost their importance. Some maintained a garrison for a while, a few until the French Revolution, but they slowly fell into decay, often becoming sherpherds' shelters or bandits hideouts.