Charles XII led the Swedish army with Swedish allies that included Holstein-Gottorp, several Polish magnates under Stanislaw I Leszczynski (1704–10) and Cossacks under the Zaporizhian Hetman Ivan Mazepa (1708–10). The Ottoman Empire temporarily hosted Charles XII of Sweden and intervened against Peter I. The war began when an alliance of Denmark–Norway, Saxony, Poland and Russia sensed an opportunity as Sweden was ruled by the young Charles XII, and declared war on the Swedish Empire. After a series of back and forth battles, the campaign ended with the destruction of the main Swedish army at the decisive 1709 Battle of Poltava (an important trading center and military depot of Russia). The coalition members partitioned most of the Swedish dominions among themselves.