By this time, Augustus was certainly ready for peace, but Charles felt that he would be more secure if he could establish someone with whom he had more influence on the Polish throne. In 1704 the Swedes installed Stanisław Leszczyński and tied the commonwealth to Sweden, which compelled Augustus to initiate military operations in Poland alongside Russia (an alliance was concluded in Narva in summer 1704). The resulting civil war in Poland (1704-1706) and the Grodno campaign (1705-1706) did not go well for Augustus. Following the Battle of Fraustadt, on 1 September 1706, Charles invaded Saxony, forcing Augustus to yield the Polish throne to Leszczyński by the Treaty of Altranstädt (October 1706).