The Great Migrations of the Serbs (), also known as the Great Exoduses of the Serbs, refers mainly to two large migrations of Serbs from various territories under the rule of the Ottoman Empire to regions under the rule of the Habsburg monarchy in the 17th and 18th centuries. The First Great Migration occurred during the Habsburg-Ottoman War (1683-1699) under Serbian Patriarch Arsenije III Crnojević as a result of the Habsburg retreat and the Ottoman reoccupation of southern Serbian regions, which were temporarily held by the Habsburgs between 1688 and 1690. The Second Great Migration took place during the Habsburg-Ottoman War (1737-1739), under the Serbian Patriarch Arsenije IV Jovanović, also parallel with the Habsburg withdrawal from Serbian regions; between 1718 and 1739, these regions were known as the Kingdom of Serbia. The masses of earlier migrations from the Ottoman Empire are considered ethnically Serb, and those of the First Great Migration nationally Serb. The First Great Migration brought about the definitive indicator of Serbianness, Orthodox Christianity and its leader, the patriarch. Background In 1683, the Ottoman Empire besieged Vienna, but was routed by an allied army that included the Holy Roman Empire led by the Habsburgs. The imperial forces, among whom Prince Eugene of Savoy was rapidly becoming prominent, followed up the victory with others, notably one near Mohács in 1687 and another at Zenta in 1697, and in January 1699, the sultan signed the treaty of Karlowitz by which he admitted the sovereign rights of the house of Habsburg over nearly the whole of Hungary (including Serbs in Vojvodina). As the Habsburg forces retreated, they withdrew 37,000 Serb families under Patriarch Arsenije III Čarnojević of the Serbian Patriarchate of Peć. In 1690 and 1691 Emperor Leopold I had conceived through a number of edicts (Privileges) the autonomy of Serbs in his Empire, which would last and develop for more than two centuries until its abolition in 1912. Before the conclusion of the war, however, Leopold had taken measures to strengthen his hold upon this country. In 1687, the Hungarian diet in Pressburg (now Bratislava) changed the constitution, the right of the Habsburgs to succeed to the throne without election was admitted and the emperor's elder son Joseph I was crowned hereditary king of Hungary. Some Serbian historians, citing a document issued by Emperor Leopold I in 1690, claim that the masses were "invited" to come to Hungary. The original