The Repnin Sejm legislation meant the end of the attempted imposition of reforms by "Familia", but brought no peace or stability, as Repnin's ruthless personal rule turned against him both the disappointed magnate oligarchs and the regular gentry, who felt that their "freedoms" were under attack. The Sejm was still in session when on 29 February 1768 the Bar Confederation was formed in Bar in Podolia, with the ostensible goals of preserving the privileges of the Catholic religion and of the "szlachta" and independence of the state. The handful of local noblemen there were soon joined by their brethren from the surrounding voivodeships and some of the military forces. Józef Pułaski, the Marshal of the Confederation, had however only five thousand men with mediocre equipment at his disposal and they were soon overpowered by the superior Russian and royal Polish forces. The surrender of the confederates under Kazimierz Pułaski in fiercely defended Berdyczów was followed by that of Bar on 20 June. The confederation leaders and the remnants of their army found shelter in Moldavia within the Ottoman Empire, but some more years of unrest and rebellion (1768–1772) were still to follow.