The royal election of 1764 resulted in the elevation of Stanislaus II Augustus (a Polish aristocrat from the Poniatowski family, connected to the Familia faction of magnates) to the monarchy. His candidacy was extensively funded by his sponsor and former lover, Empress Catherine II of Russia. The new king spent much of his reign maneuvering between his desire to implement necessary reforms to save the country from internal disorder, and the necessity to remain in a political relationship and at peace with surrounding states. This led to the formation of the 1768 Bar Confederation, a rebellion of nobles directed against the Polish king and all external influence, which ineptly aimed to preserve Poland's sovereignty and privileges held by the nobility.