In April 1815, Prince Miloš organized and led the
Second Serbian uprising. After defeating the Turks, and Napoleon's defeat in Russia, the Turks agreed to the terms of the agreement from 1815. After the killing of
Karađorđe Petrović, in 1817, Obrenović became the leader of the Serbs. As a result of the agreement, Serbia gained some autonomy, but remained under
Ottoman sovereignty. Miloš Obrenović was left in power as its absolute ruler. Between the end of 1828 and the autumn of 1830, Prince Miloš created a so-called "legislative commission" to translate the
Code Napoléon into Serbian and codify the laws and customs of the country. After discussing the commission, Miloš invited two distinguished legal specialists to come from Hungary to prepare a more suitable criminal and civil code of laws for Serbia. They were Vasilije Lazarević,
Bürgermeister (mayor) of
Zemun, and
Jovan Hadžić, lawyer, poet, and member of the municipal senate of
Novi Sad. In January 1831, Prince Miloš informed a great national assembly that he had obtained an imperial
edict from the Sultan ending all direct obligations of Serbian peasants to their former Turkish lords, guaranteeing Ottoman recognition of Serbian autonomy in most matters of internal administration, and offering Serbia the prospect of territorial aggrandizement, as well as the express right to institute schools, courts, and a governmental administration of her own. The
Sultan's decrees of 1830 and 1833 expanded the same rights to a larger territory, and made
Serbia a sovereign principality, with Miloš Obrenović as hereditary prince. A
Metropolitanate of Serbia was established in Belgrade as an autonomous unit of the
Patriarchate of Constantinople.
Russia's status as the guarantor of
Serbia's autonomy was also recognized. ==Reign==