Empress Elizabeth of Russia was staunchly opposed to Prussian expansion, and in response Frederick opposed Russia, whose troops had been allowed to freely cross the Polish–Lithuanian Commonwealth during the Seven Years' War of 1756–63. After Elizabeth's death and Peter III's abdication, Frederick and Tsar Catherine the Great signed a defensive alliance in 1764 that guaranteed Prussian control of Silesia in return for Prussian support for Russia against Austria or the Ottoman Empire. Catherine's candidate for the Polish throne, Stanisław August Poniatowski, a former lover and favourite of Catherine, was then elected King of Poland in September of that year with Frederick's support, and she gained control of Polish politics.