The great matter of the succession to the Spanish Monarchy dominated European foreign affairs following the Peace of Ryswick. The Spanish King
Charles II, severely incapacitated, could not father an heir. The Spanish inheritance offered a much sought-after prize for Charles II ruled not only Spain, but also
Naples, Sicily, the Milanese, the
Spanish Netherlands and a vast
colonial empire—in all, twenty-two different realms.
France and Austria were the main claimants to the throne, both of which had close family ties to the Spanish royal family. Philippe, duc d'Anjou (later Philip V of Spain), the French claimant, was the great-grandson of the eldest daughter of
Philip III of Spain, Anne of Austria, and the grandson of the eldest daughter of
Philip IV of Spain, Marie-Thérèse of Austria. The only bar to inheritance lay with their renunciation to the throne, which in the case of Marie-Thérèse, however, was legally null and void as other terms of the treaty had not been fulfilled by Spain. Charles, Archduke of Austria (later Holy Roman Emperor), and younger son of
Leopold I, Holy Roman Emperor by his third marriage (with Elenor of Neuburg), claimed the throne through his paternal grandmother,
Maria Anna of Spain, who was the youngest daughter of Philip III; this claim was not, however, tainted by any renunciation. Purely on the basis of the laws of primogeniture, however, France had the best claims since they were derived from the eldest daughters.
Many European powers feared that if either France or the Emperor came to control Spain, the balance of power in Europe would be threatened. Thus, both the Dutch and the English preferred another candidate, the Bavarian prince
Joseph Ferdinand, who was the grandson of Leopold I, Holy Roman Emperor through his first wife
Margaret Theresa of Spain, younger daughter of Philip IV. Under the terms of the First Partition Treaty, it was agreed that the Bavarian prince would inherit Spain, with the territories in Italy and the Low Countries being divided between the Houses of France and Austria. Spain, however, had not been consulted, and vehemently resisted the dismemberment of its empire. The Spanish royal court insisted on maintaining the entirety of the
Spanish Empire. When the Treaty became known to Charles II in 1698, he settled on Joseph Ferdinand as his sole heir, assigning to him the entire Spanish inheritance.
The entire issue opened up again when
smallpox claimed the Bavarian prince six months later. The Spanish royal court was intent on keeping the vast Spanish Empire united under one head, and acknowledged that such a goal could be accomplished only by selecting a member either of the House of France, or of Austria. Charles II, under pressure from his German wife, chose the House of Austria, settling on the Emperor's younger son, the
Archduke Charles. Ignoring the decision of the Spanish, Louis XIV and William III signed a second treaty, allowing the Archduke Charles to take Spain, the Low Countries and the Spanish colonies, whilst Louis XIV's eldest son and heir,
Louis de France, le Grand Dauphin would inherit the territories in Italy, with a mind to exchange them for Savoy or Lorraine.
In 1700, as he lay upon his deathbed, Charles II unexpectedly interfered in the affair. He sought to prevent Spain from uniting with either France or the Holy Roman Empire, but, based on his past experience of French superiority in arms, considered France as more capable of preserving the empire in its entirety. The whole of the Spanish inheritance was thus to be offered to the Dauphin's younger son,
Philippe, duc d'Anjou. In the event of his refusal or inability to accede, it would be offered to the Dauphin's third son,
Charles, duc de Berry, and thereafter to the Archduke Charles. If all these princes refused the Crown, it would be offered to the House of Savoy, distantly related to the Spanish royal family.
Louis XIV thus faced a difficult choice: he could have agreed to a partition and to possible peace in Europe, or he could have accepted the whole Spanish inheritance but alienated the other European nations. Louis XIV originally assured William III that he would fulfil the terms of their previous treaty and partition the Spanish dominions. Later on, however,
Jean-Baptiste Colbert, marquis de Torcy (nephew of Jean-Baptiste Colbert) advised Louis XIV that even if France accepted a portion of the Spanish inheritance, a war with the Holy Roman Empire would almost certainly ensue; and William III had made it very clear that he had signed the Partition Treaties to avoid war, not make it, hence he would not assist France in a war to obtain the territories granted her by those treaties. Louis XIV agreed that if a war occurred in any event, it would be more profitable to accept the whole of the Spanish inheritance. Consequently, when Charles II died on
November 1, 1700, Philippe, duc d'Anjou became Philip V, King of Spain.
Louis XIV's opponents reluctantly accepted Philip V as King of Spain. Louis XIV, however, acted too precipitately. In 1701, he transferred the "
Asiento", a permit to sell slaves to the Spanish colonies, to France, with potentially damaging consequences for British trade. Moreover, Louis XIV ceased to acknowledge William III as King of Great Britain and Ireland upon the death of James II, instead acclaiming as king James II's son and, in truth, proper heir,
James Francis Edward Stuart (the "Old Pretender"). Furthermore, Louis XIV sent forces into the Spanish Netherlands to secure its loyalty to Philip V and to garrison the Spanish forts, which had long been garrisoned by Dutch troops as part of the "
Barrier" protecting the United Provinces from potential French aggression. The result was the further alientation of both Britain and the United Provinces, which were both at that time under the rule of William III. Consequently, another
Grand Alliance was formed between Great Britain, the United Provinces, the Emperor and many of the petty states within the Holy Roman Empire. French diplomacy, however, secured as allies for Louis XIV and Philip V,
Bavaria, Portugal and
Savoy.
The subsequent
War of the Spanish Succession continued for most of the remainder of Louis XIV's reign. It began with Imperial aggression in Italy even before war was officially declared. France had some initial success, nearly capturing Vienna, but the victory of
Marlborough and
Eugene of Savoy at the
Battle of Blenheim (
13 August 1704), as well as other reverses such as the
Battle of Ramillies, the
Battle of Turin and the
Battle of Oudenarde showed that the myth of French invincibility was broken. Military defeats coupled with famine and mounting debt forced France into a defensive posture. Bavaria was flung out of the war, being partitioned between the Palatinate and Austria, and her elector,
Maximilian II Emanuel, forced to flee to the Spanish Netherlands after her conquest following the Battle of Blenheim. Portugal and Savoy subsequently defected to the opposing side. The war proved costly for Louis XIV. With the Battle of Ramillies and that of Oudenarde, Franco-Spanish forces were driven ignominiously out of the Spanish Netherlands; and the Battle of Turin forced Louis XIV to evacuate what few forces remained to him in Italy. By 1709, he was grievously weakened and was willing to sue for peace at nearly any cost, even to return all lands and territories ceded to him during his reign and to return to the frontiers of the Peace of Westphalia, signed more than sixty years prior. Nonetheless, the terms dictated by the allies were so harsh, including demands that he attack his own grandson alone to force the latter to accept the humiliating peace terms, that war continued. Whilst it became clear that France could not retain the entire Spanish inheritance, it also seemed clear that its opponents could not overthrow Philip V in Spain after the definitive Franco-Spanish victory of the
Battle of Almansa, and those of
Villaviciosa and
Brihuega, which drove the allies out of the central Spanish provinces. Furthermore, the
Battle of Malplaquet in 1709 showed that it was neither easy nor cheap to defeat the French, for while the Allies gained the field, they did so at an abominable cost, losing 25 000 men, twice that of the French, led by their admirable general,
Claude Louis Hector de Villars, duc de Villars. The
Battle of Denain, where Villars led French forces in 1712 to a decisive victory over the Allies under Prince Eugene of Savoy, turned the war in favour of Louis XIV, recovering much lost territory and pride.
The death of
Joseph I, Holy Roman Emperor, who had succeeded his father Leopold I in 1705, made the prospect of an empire as large as that of
Charles V being ruled by the Archduke Charles dangerously possible. This was, to Great Britain, as undesirable as a union of France and Spain. Thus, preliminaries were signed between Great Britain and France in the pursuit of peace. Louis XIV and Philip V eventually made peace with Great Britain and the United Provinces in 1713 with the
Treaty of Utrecht. Peace with the Emperor and the Holy Roman Empire came with the
Treaty of Rastatt and that of
Baden in 1714 respectively. The crucial interval between Utrecht and Rastatt-Baden allowed Louis XIV to capture Landau and Freiburg, permitting him to negotiate from a better position, if not from one of strength, with the Emperor and the Empire. The general settlement recognised Philip V as King of Spain and ruler of the Spanish colonies. Spain's territory in the Low Countries and Italy were partitioned between Austria and Savoy, while Gibraltar and Minorca were retained by Great Britain. Louis XIV, furthermore, agreed to end his support for the Old Pretender's claims to the throne of Great Britain. France was also obliged to cede the colonies and possessions of
Newfoundland, Rupert's Land and
Acadia, while retaining Île-Saint-Jean (now
Prince Edward Island) and Île Royale (now
Cape Breton Island), in the Americas to Great Britain; however, most of those continental territories lost in the devastating defeats in the Low Countries were returned to her, despite Allied persistence and pressure to the contrary, and she also received further territories to which she had a claim such as the
principality of Orange, as well as the
Ubaye Valley, which covered the passes through the Alps from Italy. The grandiose schemes of the Allies to turn back French expansion in Europe came to naught. Moreover, France was shown to be able to protect her allies with the rehabilitation and restoration of the Elector of Bavaria, Maximilian II Emanuel, to his lands, titles and dignities.