On 22 May 1815 Frederick Augustus abdicated as ruler of the Duchy of Warsaw, whose territory was annexed mainly to Russia, but also partly to Prussia and Austria. In the area assigned to Russia, a Kingdom of Poland was created to join in a hereditary union with the Russian throne. The old royal city of Kraków no longer belonged to the new kingdom, and became a separate republic. The internal autonomy that it enjoyed at first was abolished in 1831 after the Polish Uprising.