In 1700 Sweden was attacked by a coalition of Saxony, Russia, and Denmark–Norway. Saxony, under Augustus II, invaded Swedish oversea dominions in Livonia and quickly attacked the city of Riga. Meanwhile, Frederick IV of Denmark attacked the Swedish allied duchies of Holstein and Gottorp in order to secure his rear, before commencing with the planned invasion of Scania, which had been previously annexed by Sweden in the Treaty of Roskilde in 1658. A short time later, Russia under Peter I swept into Swedish Ingria and besieged the strategic city of Narva. Unprepared for these developments, the Swedes were forced into a war on three fronts.
Despite their significant military advantage the allied armies encountered immediate setbacks. Denmark–Norway was quickly knocked out of the war by a bold Swedish landing on Humlebæk resulting in the Peace of Travendal. After this development, the Swedish army under Charles XII was free to sail east across the Baltic sea to tackle the remaining opponents, Russia and Saxony. In response to this threat, Augustus lifted the siege of Riga and marched back across the Düna river in order to observe the Swedish movements. Charles then decided to march against Peter I of Russia, who was besieging Narva, with the aim of saving the city. Shortly later the two armies met in the battle of Narva. This ended in a decisive Swedish victory which greatly crippled the Russian army, forcing them to abandon their campaign in Swedish territory and withdraw to Russia.
Having secured two quick and decisive victories over his opponents which greatly increased his reputation, Charles marched against the Saxon forces in early 1701. These were camped on the opposite bank of the Düna. The clash occurred in the battle of Düna, ending in another Swedish victory. However, the outcome was not as decisive as Charles had hoped for. A large part of Augustus' army survived and marched into neutral Prussia. As a consequence, Charles was not able to capitalize on the previous Russian setback at Narva, but was forced to postpone the planned invasion. Instead he decided to chase the Saxon army into the Polish-Lithuanian Commonwealth, where Augustus was also king. Thus far, technically, Poland-Lithuania had stayed neutral in the conflict since Augustus began the war with Sweden in his capacity as Elector of Saxony rather than as king of Poland. Charles' purpose was to remove Augustus from the Polish throne. The subsequent conflict became known as the Swedish invasion of Poland.
In 1702, after having seized the Polish capital of Warsaw, Charles caught up and won a battle against Saxon and Polish armies at Kliszów. Even though the Swedish victory was not decisive, factions within the Polish-Lithuanian Commonwealth began supporting the Swedish cause, in opposition to Augustus. This triggered the Polish civil war of 1704-1706. The reputation of Charles and his army grew and they soon took Kraków, the "second Polish capital". Minor operations and skirmishes followed, as the Saxon and Polish–Lithuanian armies preferred to avoid facing the Swedes in direct battle.
After engagements at Pultusk and Toruń in 1703 Augustus was finally forced to abdicate the Polish throne in 1704, in favor of a monarch installed by the Swedes, Stanisław I Leszczyński. Charles and Leszczyński were supported by the Warsaw Confederation of Polish nobles. In opposition to these developments the Sandomierz Confederation was created by other nobles in support of Augustus. The latter could call on about 75% of the military capacity of the Polish army. Some smaller engagements at Poznań, Lwów, Warsaw and Poniec followed in 1704 as a consequence of Augustus' attempts to retake the throne.
Up until early 1705, Peter's efforts were focused on Livonia and Ingria, and there were few direct confrontations against the Swedish main army in Poland. After the initial outcomes in the Polish theater however, Peter assembled his army closer to the Commonwealth in order to provide assistance to Augustus against Charles, and to put pressure on the local nobility in an attempt to restore Augustus to the Polish throne. The Swedish army in turn, spent the first half of the year close to Rawicz in order to secure the coronation of Stanisław Leszczyński.
The Russian–Saxon–Polish allies assembled their armies in Lithuania for a joint offensive against the Swedes. Their troops consisted of four contingents; the main Russian army of 50,000 men under Georg Benedict Ogilvy near Polotsk, another 8,000 Russians and 10,000 Lithuanians loyal to Augustus close to Vilnius, about 6,000 Poles and 3,500 Saxons under Otto Arnold von Paykull at Brest-Litovsk and 20,000 Cossacks under Ivan Mazepa in Volhynia. In Saxony close to 20,000 men were recruited for the main Saxon army under Johann Matthias von der Schulenburg. In all, the allied forces enjoyed a massive advantage as their forces counted almost 120,000 men against the 35,000 Swedes and 10,000 Poles and Lithuanians in Poland under Charles and the 6,000 men in Courland under Adam Ludwig Lewenhaupt.
In early March 1705 the Russian Field Marshal Boris Sheremetyev set up a meeting with the Saxon general Otto Arnold von Paykull in order to agree to a common course of action in the ensuing campaign. The basis for the strategy was a plan developed by Johann Patkul as early as 1703, which envisioned a joint strike which would neutralize the Swedish army. von Paykull, inspired by Patkul's blueprint, advocated it as a way to lure Charles and the main Swedish army out of Greater Poland eastward towards Brest-Litovsk. This was to be accomplished by having the combined forces of the main Russian army under Ogilvy and von Paykull's troops stationed at Brest, which would force Charles to meet them in battle. At the same time the main Saxon army would attack Charles from the rear by sweeping through Poland out of Saxony, ultimately catching the Swedish army exposed. The plan seemed rather daring to Patkul and he suggested that the allies should first crush Lewenhaupt's army, before Ogilvy's troops approached Charles. Otherwise Ogilvy's rear would be threatened. A compromise was made between the two strategies and it was decided that Sheremetyev should engage Lewenhaupt at the same time as Ogilvy marched towards the strongly fortified city of Grodno. The belief was that there, behind fortifications, Oglivy would be able to withstand Charles long enough for the main Saxon army to arrive from Kraków. Meanwhile, von Paykull would attack with his combined Saxon–Polish force towards Warsaw in order to interrupt the coronation of Stanisław I.
The Saxon–Russian plans were put into action in early July as Sheremetyev began his march towards Lewenhaupt in Courland. The two armies met on July 26, at the battle of Gemauerthof where the Russians were defeated. Despite the outcome Lewenhaupt chose to withdraw back to Riga having suffered notable losses himself, leaving Courland open for Peter I to occupy with freshly arrived reinforcements. This worked in favor of the allies as the rear of Ogilvy's army which was marching towards Grodno was now secured accordingly.
Only five days later, on July 31, Paykull reached the outskirts of Warsaw with his army and in a surprise attack attempted to interrupt the coronation of Stanisław. In the ensuing battle of Warsaw the much smaller Swedish force under Carl Nieroth guarding the city won a decisive victory. Paykull was captured along with secret documents which informed the Swedes of a possible attack on Warsaw by a larger Russian army under Peter.
It now seems, as if the war will begin for real and have every Swede at once, by the great number of nations surrounding him, engrossed....
After having received this information while at Rawicz, Charles struck camp on August 8 and marched closer to Warsaw in order to fully protect the city until the coronation of Leszczyński was completed. He left General Carl Gustaf Rehnskiöld with 10,000 men at Poznań to guard against the main Saxon army under Schulenburg which threatened to enter Poland. On September 15, Peter I seized the town of Mitau in Courland. However, the allied successes were limited as the coronation of Leszczyński as Stanisław I of Poland was completed on October 4.
Later the same month, on October 25, the allies made a quick push to destroy the bridge going over the Vistula, from Warsaw to Praga, in order to slow down the Swedish troop movements. However, the attack was repulsed by a handful of men. A month later, on November 28, Sweden and Poland made peace in the Treaty of Warsaw through the Warsaw Confederation which increased Sweden's position even further. Charles could now march, after having waited more than a year since Augustus was dethroned, against the Russian army under Ogilvy which had already by this time reached Grodno.
Being somewhat delayed, Charles broke up his winter quarters at Blonie on January 9, 1706 and approached Grodno with the main Swedish army of 20,000 men and the 10,000 Poles and Lithuanians. A Russian army of 28,000 men was stationed there. Bad weather prevented him from marching out earlier. Urgently seeking battle Charles seemed to walk straight into the trap the allies had set for him, according to their initial plan. In Saxony, Schulenburg still waited with his 20,000 men to cross the Polish border and engage Rehnskiöld. He planned to move with his army as soon as he got word of Charles crossing the Vistula river. However, Charles commenced with a rapid winter march; this was typical for the Swedes, dating back to the time of Gustavus Adolphus, but quite unusual for continental armies. This in turn surprised the allies as they believed Charles would not begin his march before spring. Having received word of his approach however, they considered three alternatives; to meet Charles' army in the open field, fortify in Grodno, or retreat. While they disagreed among themselves about their course of action Charles' army appeared before the fortifications of Grodno on January 24, after a quick march, forcing the allies to stay in the city. Prior to the Swedish arrival, Augustus who had thus far accompanied the Russian army, broke away with 5,000 cavalry. He strove to increase his troops with another 3,000 men before uniting forces with Sculenburg and the Saxon main army whose only obstacle in order to attack Charles' army in the rear, accordingly, were the 10,000 men under Rehnskiöld stationed at Poznań.
After having scouted the Russian fortifications at Grodno, Charles realized a frontal assault would be impossible. At the same time, the Russians would not let themselves be provoked out into the field. Charles instead decided to try and starve them out by crossing the Neman river in January 15, encircling the city from the east, forcing 15,000 Russian cavalry to withdraw. In doing this he blocked the Russian communication lines, and also cut off their resources and supplies. Smaller Swedish parties were sent towards Vilnius in order to prevent General Christian Felix Bauer from supplying the trapped Russians. One of these, commanded by Jan Kazimierz Sapieha and Józef Potocki managed to beat 3,000 Russians at the Battle of Olita on February 9. Meanwhile, on February 7 Schulenburg had received word of Charles' crossing of the Vistula, and begun his march with the Saxon army in order to beat Rehnskiöld's smaller force near Poznań. Rehnskiöld, however, did not wait to be defeated and instead strove to engage Schulenburg before the arrival of Agustus 8,000 men. By using a daring feint Rehnskiöld managed to lure Schulenburg into a more disadvantageous position near Wschowa (Fraustadt), where the two armies clashed on February 13. Here, the Swedish general won a decisive victory killing or capturing up to 75% of Schulenburg's force. Crippled by this setback, the main Saxon army had no choice but to retreat. The whole allied plan collapsed, as the opportunity for the allies to destroy Charles' army in the Polish–Lithuanian Commonwealth with a sweeping movement from behind, vanished.
Shortly after, on February 22, Carl Gustaf Dücker with 1,000 dragoons fought off 7,000 Poles and Russians under Christian Felix Bauer at Olkieniki near Vilnius, capturing and killing hundreds of allied troops. He also seized the Lithuanian capital and secured the Swedish connection to Livonia. The situation in Grodno soon became unsustainable for the Russians as the soldiers began to die of starvation and disease. In order to save his army, Peter I ordered his ally Ivan Mazepa and his Cossacks to carry out continuous harassing attacks on the back of the Swedes. Mazepa dispatched 14,000 men for this purpose. However, the Swedes countered the move, sending large contingents of troops from Grodno to assault Mazepa's nearby outposts. Mazepa sustained large casualties at both Nesvizh on March 23, where Johan Reinhold Trautvetter and his 500 Swedish dragoons killed and captured around 700 out of 1,200 Cossacks, and at Lyakhavichy in late March, where Carl Gustaf Creutz held 1,400 men trapped inside the fortress.
On March 27, the Russians received word about the earlier disastrous defeat at Wschowa. Peter I realized that the chances of a combined attack on Charles were now minimal. He ordered Ogilvy to attempt an escape from the encirclement at Grodno and a retreat towards Brest-Litovsk. Ogilvy carried out the order on April 4 and managed to break out unseen with his reduced army, leaving 8,000 men behind at Grodno who had died of starvation and sickness. Another 9,000 men were lost during the retreat as the Swedes pursued the Russians as far as Polesia, where they finally gave up the chase. Mazepa met a similar defeat, as he sent 4,700 men in an attempt to save the Cossacks trapped inside Lyakhavichy. Instead these were annihilated in the battle of Kletsk on April 30, after which the garrison in Lyakhavichy surrendered to the Swedes on May 12 and the fortress was destroyed. In total, almost 10,000 Cossacks were killed, out of the initial 14,000 who actively participated in the campaign.
Charles had won one of his greatest victories at Grodno 1706, by simply cutting off his opponents' resources and supplies. Later, in a letter to his ally Frederick IV of Denmark, Peter I confirmed losses of up to 17,000 men during the encirclement and retreat. After his pursuit of the Russian army, having chased them out of Lithuania, Charles saw his opportunity to march back to Poland in order to meet up with Rehnskiöld, in preparation for the invasion of Saxony. He arrived there in August 5. Meanwhile, Schulenburg did what he could in an attempt to increase the Saxon army to measure the expected invasion from the Swedes, something which was proven close to impossible after the battle of Fraustadt. In a last attempt to stop the invasion, Augustus II of Saxony offered Courland to Sweden and Lithuania to the newly crowned king Stanisław I of Poland. The generous offer was, however denied by Charles who crossed the Saxon border in September 5. As Saxony was close to defenseless, the Swedes could easily push away any resisting troops. In September 19, they occupied the city of Leipzig which finally forced Augustus into unconditional peace under Swedish terms. Among other things, the traitor and second principal behind the Grodno campaign, Johann Patkul was turned into Swedish custody.
The campaign of Grodno proved disastrous to the allies who did not manage to attain any of their goals, while the Swedish army reached almost all of theirs; Stanisław Leszczyński was crowned king of Poland, the Saxon and Russian armies in Poland were beaten, and peace was forced upon Augustus who renounced all his claims to the Polish throne. The two traitors and principal designers of the campaign, Johann Patkul and Otto Arnold von Paykull were also taken prisoner by the Swedes and executed in 1707. However, the Great Northern War was far from being won. Charles reorganized his forces to march against his last remaining opponent, Peter the Great and the Tsardom of Russia. The Swedish invasion of Russia began in 1707 and ended with the disastrous Swedish defeat at Poltava. This marked a decisive turn in the war with Saxony and Denmark rejoining the alliance.