Already by 1769–71, both Austria and Prussia had annexed some border territories belonging to the Commonwealth. On 19 February 1772, the agreement of partition was signed in Vienna. A previous agreement between Prussia and Russia had been made in Saint Petersburg on 6 February 1772. Early in August Russian, Prussian and Austrian troops simultaneously entered the Commonwealth and occupied the provinces agreed upon among themselves. On 5 August, the three parties signed the treaty on their respective territorial gains at the Commonwealth's expense. The partition treaty was ratified by its signatories on 22 September 1772.