The Warsaw Confederation () was a confederation against King of PolandâÂÂLithuania Augustus II the Strong. It was formed on 16 February 1704 in Warsaw. With the backing of Charles XII of Sweden, it dethroned August II and declared Stanisà Âaw Leszczyà Âski king. In response on 20 May 1704, the supporters of August II formed the Sandomierz Confederation. The Warsaw Confederation was eventually victorious in the civil war in Poland, which ended with the Treaty of Altranstädt. Soon, however, after the Swedish defeat in the Battle of Poltava, the Russians prevailed, and Augustus II resumed the Polish throne in 1709.