In 1783, the Treaty of Georgievsk was signed through which the Kingdom of Georgia, while retaining its autonomy and its ancient monarchy was placed under the protection of the Russian Empire. In 1801 after the death of George XII, the last King of Georgia, Tsar Alexander I of Russia in violation of the treaty, annexed the kingdom of Georgia and the Bagration dynasty lost its throne. The Bagrations became a leading family of the Russian nobility, serving in the Tsar's army and at court in Saint Petersburg. The former ruling branch became extinct in the late 19th century , when it passed its succession rights to the branch to which Grand Duchess Leonida belonged, but this too is disputed.