The Bosnian uprising was a revolt of Bosnian ayans against the Ottoman Sultan Mahmud II. The casus belli were reforms implemented by the Sultan to abolish the ayan system. Despite winning several notable victories, the rebels were eventually defeated in a battle near Sarajevo in 1832. Internal discord contributed to the failure of the rebellion, because Gradaščević was not supported by much of the Herzegovinian ayans. As a result, Ali Pasha Rizvanbegović was named pasha of the Herzegovina Eyalet which was seceded in 1833. The Sultan implemented the new the pasha's representative system, abolishing the old ayan system. The new pasha's representatives were mostly old ayans, but in 1850 Omer Pasha completely eliminated old ayan families. Background Sultan Mahmud II started the process of reforms in the Ottoman Empire with the ultimate goal of strengthening the central authorities and modernising the Ottoman state to follow the European trend. The abolishment of the Spahi system and the Janissaries was the beginning of the reforms, with ultimate goal to transforming the theocratic Ottoman Empire into a constitutional monarchy. The reforms also aimed at formal equality of all subjects before the law, regardless of their ethnicity or religion, as well as their equal obligations towards the state, regardless of their social status. The Bosnian ayans, as well as the Janisaries in Bosnia, resisted the reforms, for the reason that they wanted to keep their privileges and tax revenues and did not want to contribute manpower to the imperial army. They preferred to keep the status quo. The reforms meant the end of these privileges and the disappearance of their independence. Mahmud II managed to destroy such independent magnates in Bulgaria, southern Albania and Anatolia. There were also emotional reasons for this resistance of the Bosnian ayans, who were religiously conservative. The reforms announced from Istanbul were seen as "infidel" because they copied Europe in order to strengthen the empire and were seen as a threat to Islam. The view of the ayans was that the Ottoman rule and the Islamic faith can only be maintained if they retained power. Janisaries' revolt in Sarajevo The first attempts at reform in Bosnia began in 1826. That year, Sultan Mahmud II introduced the reformed Nizam military and effectively disbanded the Janissaries throughout the empire. However, the ayans in Bosnia protected the Janissaries and refused to implement the sultan's decree. The Janisaries revolted in Istanbul and were