Rijeka, formerly known as Fiume, is a city located in the northern tip of the Kvarner Gulf in the northern Adriatic. It was part of the Roman province of Dalmatia, and later of the Kingdom of Croatia. It grew during the 12th to 14th centuries as a seaport within the Holy Roman Empire, trading with Italian cities. Under the ownership of the House of Habsburg from 1466, it was made a free city, and although part of the Duchy of Carniola it developed organs of local self-government.
During the 16th and 17th centuries Rijeka came under attack from both Turkish and Venetian forces, and became a base for irregular Habsburg troops known as Uskoks. Its maritime trade was suppressed by Venice until the late 17th century, when peace was concluded and the Habsburgs set about developing the city as a major port. Sugar refineries and other industries were also introduced. Rijeka was attached to the Kingdom of Hungary in 1779, retaining autonomous status, although the Kingdom of Croatia also maintained a claim.
Rijeka was occupied by Napoleonic France between 1809 and 1813 as part of the Illyrian Provinces. After reconquest by Austria, it was placed within the Kingdom of Illyria until 1822 and then restored to Hungary. Industrial development recommenced, the port was modernised and a naval base created, and railways were constructed connecting the city with Hungary and Serbia. On the Austro-Hungarian Compromise of 1867, Hungary gained equal status with Austria, and Rijeka, as Hungary's main port, became a rival to Austria's port of Trieste. Under the leadership of Giovanni de Ciotta the city was extensively rebuilt during the late 19th century. Resulting from further industrial expansion and immigration, Italians became the largest single group in the city.