Charles responded on 4 August 1700 with a bold invasion of Zealand, taking his army through dangerous seas and marching on Copenhagen, forcing the Danes out of the war. By the Treaty of Travendal (18 August 1700), Denmark agreed to return Schelswig and not to fight against Sweden. In October he crossed to Livonia with a tiny army of 8,000 men. Once there he decided to march to Narva, besieged by Peter the Great with 40,000 men. As Charles approached, Peter fled, leaving his army to fight alone, and on 30 November 1700 the Russian army was destroyed in the battle of Narva, fought in a snowstorm. Over the winter of 1700/1, Charles prepared to march on Livonia, where on 17 June 1701 he defeated a joint Russian, Polish and Saxon army at the battle of Riva, relieving the year long siege.
Charles then turned on Poland, invading in July 1701 and defeated a joint Saxon and Russian army at the battle of Dunamunde (9 July 1701). In 1702, Charles still concentrated on Poland, capturing Warsaw in May, before seeking out battle against Augustus. On 2 July 1702, he routed a larger Polish-Saxon army at the battle of Kliszow, before siezing Cracow, and proceeding to take control of Poland, defeating another Polish and Saxon army at the battle of Pultusk (13 April 1703). This left Peter the Great free to invade Ingria, where he defeated a Swedish army at the battle of Errestfer (7 January 1702), then at the battle of Hummselsdorf (18 July 1702), gaining control of the Neva Valley. The following year, Peter reached the mouth of the Neva, and on 16 May 1703 founded St. Petersburg, regaining direct access to the Baltic for Russia.
The same pattern continued in 1704. Charles concentrated on Poland, where Stanislas Leszczynski, his candidate for the throne, fought Augustus, while Peter concentrated on securing the area around St. Petersburg. Charles remained in Poland through 1705, before chasing the Russian's out of Lithuania in early 1706. At the same time, another attempt by Augustus to regain Poland was stopped at the battle of Franstadt (3 February 1706). In August-September 1706, Charles finally defeated Augustus by invading Saxony, where after he siezed Leipzig, Augustus sued for peace, and by the treaty of Altranstadt (24 September 1706) abdicated the throne of Poland. At this point, Peter also sued for peace. If Charles had taken this change, he would have achieved a stunning victory against overwhelming odds, but Charles felt that he could gain a better result by continuing the war.
After a brief dispute with the Empire, Charles prepared for his invasion of Russia. Like so many invaders, Charles was to come to grief in Russia. On 1 January 1708, Charles crossed the frozen Vistula with his army of 45,000 men, his largest ever army, and made good progress, before waiting out the spring thaw near Minsk (March-June). When he started moving, Charles had some initial successes. On 4 July 1708 he defeated Russian forces guarding the river Bibitch at the battle of Holowczyn, and reached the Dnieper in early July. At this point, Peter initiated a scorched earth policy, slowly retreating before the Swedes, destroying all food and crops, and refusing battle, leaving the Swedish army desperately short of supplies. Charles's response was to decide to march into the Ukraine, where he expected to join up with a Cossack revolt, while at the same time ordering a supply column from Sweden to join him there. This was a dreadful error. Peter had learnt of the planned Cossack revolt, and in October 1708 managed to preempt it, while on 9-10 October 1708, the Swedish supply column of 11,000 men was defeated by a larger Russian army (battle of Lesnaja). Only 6,000 troops from the column reached Charles, after having to destroy the desperately needed supplies.
This left Charles stranded in Russia for the winter of 1708-9, one of the coldest ever in Europe. The Russians harrassed the Swedes all winter, and by the spring Charles had lost over half of his original army, although managing to maintain any fighting force was an impressive achievement. When campaigning began in 1709, Charles engaged in the siege of Poltava. Peter the Great gathered an army of 80,000 men, and at the battle of Poltava (28 June 1709), crushed the Swedish army, taking 18,794 prisoners. Charles himself escaped to Turkish Moldavia, and remained in Turkey until 1714. In the meantime, Russian and her allies were free to dismember the Swedish empire. In August-December 1709 Peter invaded Poland, reinstating Augustus, and also occupied the Baltic coast. The Danes retook Schleswig, along with Bremen and Verden, also Swedish, while another Danish army occupied Skane in southern Sweden. Another Danish, Polish and Saxon army invaded Swedish Pomerania (now the Polish coast), but were repulsed. The Danes were repulsed from Sweden early in 1710, and the Swedes concentrated on defending their German possessions.
The war took another twist in October 1710, when Charles XII, still in Turkish Moldavia, pursuaded the Turks to declare war on Russian, and a 200,000 strong Turkish army was sent to the border. Peter responded by invading Moldavia with 60,000 men (March-July 1711), where he was promptly outmaneuvered by the Turks, who pinned him against the Pruth River. However, at this point the Turks failed to press their advantage, instead negotiating a peace with Peter (Treaty of Pruth, 21 July 1711), which concentrated on Turkish issues. Charles was furious at the easy terms, and refused to leave Turkey for another four years, eventually having to escape from virtual house arrest, and crossing Europe with a single servant, he finally returned to Swedish territory on 11 November 1714. In the meantime, the war had continued, with little effect despite repeated Swedish defeats, although Russian managed to gain naval dominance in the Baltic.
The return of Charles put new life into the Swedish war effort, although once again he refused several chances to make a good peace. After detering an attempt to invade Sweden (1716), Charles decided to attack Norway, then united with Denmark (1717-1718). It was on this campaign that Charles met his death, shot through the head during the siege of Fredriksten (11 December 1718). 1719 and 1720 saw the Russians use their new control of the Baltic to launch repeated raids against mainland Sweden, and eventually the Swedes sued for peace. Sweden managed to negotiate good terms with Denmark, Poland and Saxony, with a return to the pre-war state, although some of Swedish Pomerania was lost to Prussia. However, peace with Russia was not made until the Treaty of Nystad (30 August 1721), which was not so generous. Russia kept most of the Baltic coast, but returned Finland to Sweden, and paid an indemnity. The war left the balance of power in the Baltic permanently changed, with Russia newly emerged as a major European power, and Sweden relegated from that status.