Already by 1769–1771, both
Austria and Prussia had taken over some border territories of the Commonwealth, with Austria taking the
Eldership of Spisz,
Czorsztyn,
Stary Sącz and
Nowy Targ in 1769–1770 and Prussia incorporating
Lauenburg and Bütow. On February 19, 1772, the agreement of partition was signed in
Vienna. A previous agreement between Prussia and Russia had been made in Saint Petersburg on February 6, 1772. In early August, Russian, Prussian and Austrian troops simultaneously entered the Commonwealth and occupied the provinces that had been agreed upon among themselves. On August 5, the three parties signed the treaty on their respective territorial gains. The regiments of the Bar Confederation, whose executive board had been forced to leave Austria, which had supported them, after Austria joined the Prusso–Russian alliance, did not lay down their arms. Many fortresses in their command held out as long as possible.
Wawel Castle in
Kraków fell only at the end of April;
Tyniec Fortress held until the end of July 1772;
Częstochowa, commanded by
Casimir Pulaski, held until late August. In the end, the Bar Confederation was defeated, with its members either fleeing abroad or being
deported to Siberia by the Russians. ==Division of territories==