King Stanislaus Augustus was at first inclined to mediate between the Confederates and Russia, the latter represented by the Russian envoy to Warsaw, Prince Nikolai Repnin; but finding this impossible, he sent a force against them under Grand Hetman Franciszek Ksawery Branicki and two generals against the confederates. This marked the Ukrainian campaign, which lasted from April till June 1768, and was ended with the capture of Bar on 20 June. Confederation forces retreated to Moldavia. There was also a pro-Confederation force in Lesser Poland, that operated from June till August, that ended with the royal forces securing Kraków on 22 August, followed by a period of conflict in Belarus (August–October), that ended with the surrender of Nesvizh on 26 October.