In the 1790s , the Ottoman Sultan Selim III granted the Serbs in the Sanjak of Smederevo ( central Serbia ) the right to run their own affairs in exchange for their cooperation with the governor of Belgrade , Hadži Mustafa Pasha . Following the Slaughter of the Knezes in February 1804 , a revolt led by Karađorđe Petrović erupted against the Ottoman janissary junta ( the " Dahije " ) in Serbia . The Serbs initially received the support of Selim and managed to defeat the corrupt janissaries by the end of the year . Facing great pressure not to cooperate extensively with his Christian subjects , Selim began to view the Serbs as rebels by the spring of 1805 . He appointed the Ottoman governor of Niš , Hafiz Pasha , as the new governor of Belgrade and ordered him to confront the Serbian insurgents . The Ottoman Turkish forces were highly trained
Slaughter of the Knezes
Slaughter of the Knezes
Battle of Ivankovac