 He later joined the anti-Russian Bar Confederation.Defeated by the Russian forces under Alexander Suvorov in the Battle of Stołowicze, he was forced into exile.However, in 1768 he was allowed to return and was nominated to the rank of the Grand Hetman of Lithuania, thus becoming one of two highest-ranking military commanders in the Polish–Lithuanian state.