The Ottoman ruler Selim III granted Serbs limited autonomy within the Ottoman Empire; later restrictions on this autonomy, imposed by corrupt janissaries, led to a successful revolt against the Turks. The 1804 Serb uprising was led by Kara Djordje, or Black George- arguably the most successful one-time pig farmer in history. Selim III had the Janissary leaders executed; the Serbs conquered the Belgrade Pashalik by 1806. Serbia was re-conquered in 1813; Kara Djordje fled into Habsburg lands. Other uprisings occurred alongside Black George’s insurrection, including one in Eastern Slavonia that Roma took part in. Several Serbs who accepted Ottoman vassalage became puppet rulers; one of them, Miloš Obrenovic, led another revolt in 1815. Russia pressured Turkey into accepting Obrenovic’s rule over Serb lands. As a conciliatory gesture, Obrenovic captured Kara Djordje, decapitated him and had the head dispatched to Selim III.
Roma continued to pour into Serbia from Wallachia and Moldavia, where they were slaves; they were welcomed for the purpose of taxation. These Roma settled among the Serbs; many of them became thoroughly Serbianized in language, culture and religion. Muslim Roma were simultaneously persecuted. They, along with Albanians and Turks, were expelled from Serbian lands. Serbia became officially independent after the Treaty of Berlin in 1878.