war permanently damaged their economy. France withdrew backing for the exiled Jacobites and recognised the Hanoverians as heirs to the British throne; ensuring a friendly Spain was a major achievement, but left them financially exhausted. The decentralisation of the Holy Roman Empire continued, with Prussia, Bavaria and Saxony increasingly acting as independent states. Combined with victories over the Ottomans, this meant Austria increasingly switched focus to southern Europe. Background Charles II of Spain succeeded his father Philip IV at the age of four in 1665. Subject to extended periods of ill-health for much of his life, his death was anticipated almost from birth, and the issue of his successor a matter of diplomatic debate for decades, the two main contenders being Louis XIV of France and Emperor Leopold I. In the 1670 Secret Treaty of Dover, Charles II of England agreed to support the rights of Louis XIV, while the 1689 Grand Alliance committed England and the Dutch Republic to back those of Leopold. In 1700, the Spanish Empire included possessions in Italy, the Spanish Netherlands, the Philippines and the Americas, and though no longer the dominant great power, it remained largely intact. Since the Spanish refused to allow their Empire to be divided and its acquisition by either the Austrian Habsburgs or French Bourbons would change the balance of power, its inheritance led to a war that involved most of Europe. The 1700–1721 Great Northern War is considered a connected conflict, since it affected the involvement of states such as Sweden, Saxony, Denmark–Norway and Russia. During the 1688–1697 Nine Years' War, armies grew from an average of 25,000 in 1648 to over 100,000 by 1697, which required a level of expenditure unsustainable for pre-industrial economies. The 1690s also marked the lowest point of the Little Ice Age, a period of cold and wet weather that drastically reduced crop yields across Europe. The Great Famine of 1695–1697 killed an estimated 15–25% of the population in present-day Scotland, Scandinavia and the Baltic states, plus another two million in France and Northern Italy. The 1697 Treaty of Ryswick was the result of mutual exhaustion and the acceptance by Louis that France could no longer achieve its objectives without allies. Since the question of the succession was left unresolved, Leopold signed the treaty with extreme reluctance in October 1697, by which time it was clear Charles would die childless and a resumption of