The Ottomans resettled Orthodox Serbs from Bosnia into the desolated areas of the Kninska Krajina and Bukovica, while Boka Kotorska received constant Serb migrations from Herzegovina and Montenegro. The Serbs formed a significant part of the population of Dalmatia in the 16th century, with absolute majorities in the Kninska Krajina, Bukovica and Boka Kotorska. A great portion of this population fled to Venetian land and gladly fought against the Ottomans. The number of Serbs in Venetian Dalmatia rapidly increased during the War of Candia in 1645 - 1669 and the Great Turkish War in 1683 - 1699, after which the peace of Karlowitz gave Venice the whole of Dalmatia as far south as Ston, as well as the region beyond Ragusa, from Sutorina to Boka kotorska. After the Venetian-Turkish war 1714–1718, Venetian territorial gains were confirmed by the 1718 Treaty of Passarowitz.