For the next four centuries, the Kingdom of Croatia was ruled by the Sabor (parliament) and a ban (viceroy) appointed by the king. This period saw the rise of influential nobility such as the Frankopan and Šubić families to prominence, and ultimately numerous Bans from the two families. There was an increasing threat of Ottoman conquest and a struggle against the Republic of Venice for control of coastal areas. The Venetians controlled most of Dalmatia by 1428, except the city-state of Dubrovnik, which became independent. Ottoman conquests led to the 1493 Battle of Krbava field and the 1526 Battle of Mohács, both ending in decisive Ottoman victories. King Louis II died at Mohács, and in 1527, the Croatian Parliament met in Cetin and chose Ferdinand I of the House of Habsburg as the new ruler of Croatia, under the condition that he protects Croatia against the Ottoman Empire while respecting its political rights.