In Poltava, the Swedish Empire lost the initiative in the Great Northern War. With Charles XII of Sweden's main army destroyed, the anti-Swedish alliance of the Tsardom of Russia, Denmark-Norway and Saxe-Poland-Lithuania re-constituted in the Treaty of Thorn and the Treaty of Copenhagen, the Swedish king exiled to Bender and Sweden's provinces of Finland and Livonia invaded, the Swedish defense relied on 11,800 soldiers garrisoned in northern Germany, and an army of 10,000 men in Greater Poland commanded by Ernst Detlof von Krassow. The latter was in full retreat, harassed by Saxon forces and a plague that had broken out in Poland.