of the Duchy of Carniola. As a reichsfrei city, or territory (Fiume was a terra), the city was under the direct authority of the Holy Roman Emperor and the Imperial Diet, without any intermediary liege lord. The advantages were that reichsfrei regions had the right to collect taxes and tolls themselves, and to hold their own juridical courts. Imperial immediacy corresponded to a de facto semi-independence with a far-reaching autonomy. In 1599, Fiume became a de facto independent city commune, emancipated from the Duchy of Carniola, although the Carniolan estates continued unsuccessfully to claim their rights upon the city – right up to their cessation in 1809. From 1530, the late-medieval commune was ruled according to the Statute of Fiume, this charter formally lasting until 1850. The first codified statute preserves some features of the medieval Croatian statutes, still with a preponderance of Italian and Venetian institutions. According to the statute, the executive power was in the hands of a great council (Gran Consiglio) of 50 members and a lesser council (Piccolo Consiglio) of 25 patricians. The Captain was the representative of the feudal lord (from 1466 the Habsburg archduke). The local executives, justice rectors (giudici rettori), have to obey only the lord – from 1466 the duke (later emperor) of the House of Habsburg. Thus, in its local corporate representation, Fiume was a mixture of a tradition of local self-government and the Reichsfreiheit or Reichsunmittelbarkeit of the free cities of the Holy Roman Empire. Turkish wars By the 19th century, Fiume had become the most important port in the eastern half of the Habsburg empire, but its beginnings were modest: at the dawn of the modern age, it was still small, with fewer than 5,000 inhabitants. After the disaster of the Battle of Mohács in 1526, the Kingdom of Croatia and the Kingdom of Hungary accepted the sovereignty of the Habsburgs in order to defend themselves from Turkish invasions. After 1526, the stretch of territory (the littoral) south of Fiume and north of the Zrmanja River was held by the House of Austria, when it inherited the crowns of Croatia and Hungary. Venetian Dalmatia included the lands south of Cattaro. As such, these lands were permanently on the frontline, intended to bring to a halt the Ottoman advance that stopped short of the Gulf of Quarnero. Until the late 17th century, the Habsburg monarchy possessed essentially a landlocked territory,