Spain (the support of Aragon to the Count of Toulouse, death in Perpignan of Philip III of France married to Isabel of Aragon, and Albigenses Crusades are some of the most famous examples) and played a significant political role in the start of the Catalan Revolt which ended with the treaty of Pyrenees. 17th century The Franco-Spanish War broke out in 1635, when French king Louis XIII felt threatened that his entire kingdom was bordered by Habsburg territories, including Spain. In 1659, the Treaty of the Pyrenees ended the war and ceded the Spanish-possessed Catalan county of Roussillon to France, which had supported the Principality of Catalonia in a revolt against the Spanish crown. Western Flanders, roughly equivalent to the modern French department of Nord, was also ceded. An anomaly of the treaty was that although all villages in Roussillon were ceded to France, Llívia was deemed to be a city and was therefore retained by Spain to the present day as an exclave into France. The treaty was signed on Pheasant Island, an uninhabited, unserviced island in the Bidasoa river between the French commune of Hendaye and the Spanish municipality of Irun. Both settlements, and therefore their countries, took sovereignty of the island for six months out of each year. After Philip IV of Spain defeat, Marie-Thérèse of Austria, Infant of Spain, was married to the king of France Louis XIV. 18th century In 1701, after the death of the last Habsburg king of Spain, Charles II, the French House of Bourbon, led by Louis XIV, staked a claim to the Spanish throne. The war ended with the Bourbon Philip V being recognised as King of Spain. The House of Bourbon remains on the Spanish throne to the present day. The wars were very expensive; despite Mexican silver Spain declines economically. 19th century Revolutionary France and Bourbon Spain signed the Treaty of San Ildefonso in 1796 as part of their shared opposition to Britain. The relationship spoiled after defeat in 1805 at the Battle of Trafalgar, and in 1808, French Emperor Napoleon invaded Spain and named his brother Joseph as King of Spain as part of a plan to get closer to invading Britain's ally, Portugal. The British under the Duke of Wellington drove the French out of Spain in 1813 following the Battle of Vitoria. The Bourbon king Ferdinand VII was imprisoned by Napoleon, but still remained recognised