A nephew of king Stanislaus Augustus of Poland (), Poniatowski began his military career in 1780 in the Austrian army, where he attained the rank of colonel. In 1789, after leaving Austrian service, he joined the Polish army at the request of his uncle. Poniatowski, now in the rank of major general and commander of the Royal Guards, took part in the Polish–Russian War of 1792, leading the crown forces at the victorious Battle of Zieleńce. After the king's support for the Targowica Confederation of 1792, Poniatowski felt compelled to resign. In 1794 he participated in the Kościuszko Uprising and took charge of defending Warsaw - for which the Russian authorities subsequently exiled him until 1798.