Ottoman conquests led to the Battle of Krbava field (1493) and the Battle of Mohács (1526), both decisive Ottoman victories, the latter of which caused a succession crisis in the Kingdom of Hungary. In the 1527 election in Cetin, Ferdinand I of Habsburg was chosen as the new ruler of Croatia, under the condition that he provide protection to Croatia against the Ottoman Empire, which had extended as far as Lika in the immediate hinterland of the region since 1522. As the region became a point of contention between the Habsburgs, Ottomans, and Venetians, its defense was given high importance in the newly established Croatian Military Frontier, as exemplified by the Uskoks of Senj. After the Ottoman conquest of their original base in Klis, the Uskoks established a new headquarters in Nehaj Fortress as a bulwark against westward expansion by the Ottomans. They also launched raids against Christian communities under Ottoman rule and Venetian commerce and subjects. Increasing conflict between the Uskoks and Venice culminated in 1615 – 1617 Uskok War, which resulted in the resettling of the Uskoks, whose final years in Senj were marked by piracy and looting. Between 1684 and 1689, the Ottomans were forced to retreat from Lika and the entire hinterland of the region.