The forces of the Targowica Confederation defeated the troops loyal to the Polish–Lithuanian Commonwealth, the Sejm and King Stanisław August Poniatowski in the Polish–Russian War of 1792. As a result, the King, Poniatowski, formally joined the Confederation. Their victory precipitated the Second Partition of Poland and set the stage for the Third Partition and the final dissolution of the Commonwealth in 1795. This outcome came as a surprise to most of the Confederates, who had wished only to restore the status quo ante and had expected that the overthrow of the May 3rd Constitution would achieve that end.