Already, in the period of the roman republic, the island in the northern Adriatic was covered with several complexes of luxurious Roman villas with baths, mosaic floors and frescoes on the walls. However, it was in the 6th century when the population from the surrounding area settled the island in turbulent times and the Byzantines fortified the city they called Iustinopolis. In the 8th century, the hinterlands were settled by the Slavic speaking populations, slowly pushing towards the urbanized coast.
Wars with Venice and epidemics of plague marked the centuries. Though it was in 1561 that the later famous doctor, the inventor of the thermometer, Santorio Santorio was born in Koper. The city started the process of modernization in 1891 when the city walls were removed and in 1827, the island was linked to the mainland by an earth bank. The surrounding lagoon was transformed into salt fields, which were later improved into farmland and recently covered by the infrastructure of the modern port.