War. He served as an adjutant to Michał Franciszek Sapieha, and later commanded a company of cuirassiers. He participated in the Battle of Zenta in 1697. After the Treaty of Karlowitz of 1699, which ended the war, he returned to Lithuania. Upon his return, he wed Teresa Woynianka-Jasieniecka, but their marriage ended abruptly with her death not long afterward. The union, however, raised his social status. In 1700, he participated in the Lithuanian Civil War as a supporter of the Sapieha family, fighting in the Battle of Valkininkai. Here, he was captured, but managed to escape, and he later served as Sapieha's emissary to Charles XII, king of Sweden. The Great Northern War and subsequent Swedish service In 1702, Swedish forces invaded the Commonwealth as part of the Great Northern War, which had begun in 1700 between the Swedish Empire and the Tsardom of Russia. Augustus II, king of Poland and Elector of Saxony, was an ally of the Russian tsar Peter I. Augustus's forces were defeated, and the king himself was forced back to Saxony. He was replaced by Charles with Stanisław Leszczyński, a Polish nobleman and count of the Holy Roman Empire. Poniatowski, serving as a negotiator between the Wielkopolska Confederation and Charles XII, took the side of Leszczyński and distanced himself from the Sapiehas, formerly his patrons. In 1705, he became the colonel over Leszczyński's newly raised Trabant guard, modeled after the reputable Swedish Drabant Corps. In 1708, Leszczyński appointed Poniatowski his personal representative to Charles XII. He participated in the Battle of Holowczyn that year, and served as an aide to Charles XII during his exile in the Ottoman Empire after the Battle of Poltava in 1709. Here, he worked to establish an alliance between the Ottomans and the Swedes, aiming to bring the Ottomans into the war against Russia. Due to diplomatic efforts on the part of the French, aligned with Sweden, the Ottomans began to campaign against the Russians in 1710. With this change in Ottoman foreign policy came the dismissal of Çorlulu Ali Pasha, Grand Vizier of Ahmed III. His successor, Köprülü Numan Pasha, was an acquaintance of Poniatowski and had been a supporter of an anti-Russian shift in Ottoman politics. Poniatowski accompanied the Ottomans during the Pruth River Campaign, but was dissatisfied with the Treaty of the Pruth, which saw the withdrawal of the Ottomans from the war. His attempts to prolong