For the next quarter century, Poland was often a pawn in Russia's campaigns against other powers. When John III died in 1697, 18 candidates vied for the throne, which ultimately went to Frederick Augustus of Saxony, who then converted to Catholicism. Ruling as Augustus II, his reign presented the opportunity to unite Saxony (an industrialized area) with Poland, a country rich in mineral resources. The King however lacked skill in foreign policy and became entangled in a war with Sweden. His allies, the Russians and the Danes, were repelled by Charles XII of Sweden, beginning the Great Northern War. Charles installed a puppet ruler in Poland and marched on Saxony, compelling Augustus to give up his crown and turning Poland into a base for the Swedish army. Poland was again devastated by the armies of Sweden, Russia, and Saxony. Its major cities were destroyed and a third of the population killed by the war and a plague outbreak in 1702-13. The Swedes finally withdrew from Poland and invaded Ukraine, where they were defeated by the Russians at Poltava. Augustus was able to reclaim his throne with Russian support, but Tsar Peter the Great decided to annex Livonia in 1710. He also suppressed the Cossacks, who had been in revolt against Poland since 1699. Later on, the Tsar frustrated an attempt by Prussia to gain territory from Poland (despite Augustus' approval of this). After the Great Northern War, Poland became an effective protectorate of Russia for the rest of the 18th century. The wide-ranging European War of the Polish Succession, named after the conflict over the succession to Augustus II, was fought from 1733–1735.