measures such as the Statuta Wallachorum of 1630. Much of central Serbia switched from Ottoman rule to Habsburg control (1686–91) during the Habsburg-Ottoman war (1683–1699). Following several petitions, Emperor Leopold I formally granted Serbs who wished to settle in the northern regions the right to their autonomous crown land. The ecclesiastical centre of the Serbs also moved northwards, to the Metropolitanate of Karlovci, and the Serbian Patriarchate of Peć was once-again abolished by the Ottomans in 1766. In 1718–39, the Habsburg monarchy occupied much of Central Serbia and established the Kingdom of Serbia as crownland. Those gains were lost by the Treaty of Belgrade in 1739, when the Ottomans retook the region. Apart from territory of modern Vojvodina which remained under the Habsburg Empire, central regions of Serbia were occupied once again by the Habsburgs in 1788–1792. Revolution and independence The Serbian Revolution for independence from the Ottoman Empire lasted eleven years, from 1804 until 1815. The revolution comprised two separate uprisings which gained autonomy from the Ottoman Empire (1830) that eventually evolved towards full independence (1878). During the First Serbian Uprising (1804–1813), led by vožd Karađorđe Petrović, Serbia was independent for almost a decade before the Ottoman army was able to reoccupy the country. Shortly after this, the Second Serbian Uprising began in 1815. Led by Miloš Obrenović, it ended with a compromise between Serbian revolutionaries and Ottoman authorities. Likewise, Serbia was one of the first nations in the Balkans to abolish feudalism. The Akkerman Convention in 1826, the Treaty of Adrianople in 1829 and finally, the Hatt-i Sharif, recognised the suzerainty of Serbia. The First Serbian Constitution was adopted on 15 February 1835 (the anniversary of the outbreak of the First Serbian Uprising), making the country one of the first to adopt a democratic constitution in Europe. 15 February is now commemorated as Statehood Day, a public holiday. Following the clashes between the Ottoman army and Serbs in Belgrade in 1862, and under pressure from the Great Powers, by 1867 the last Turkish soldiers left the Principality, making the country de facto independent. By enacting a new constitution in 1869, without consulting the Porte, Serbian diplomats confirmed the de facto independence of the country. In 1876, Serbia declared war on the Ottoman Empire, siding with the ongoing Christian uprisings in Bosnia-Herzegovina and Bulgaria. The formal independence of the country was internationally recognised at the Congress of Berlin in