Kotor is one of medieval towns that has preserved, in the best way, its urban structure and continuity of life. By the area encompassed by its walls, it is the biggest medieval town in Montenegro . Science has not yet answered the question whether the present-day Kotor lies at the site of antique Acruvium. The Ravenna Geographer refers to the present-day Kotor as Dekadaron or Dekadoron in the 9th century, when it belonged to Byzantium . The Byzantine rule, real or nominal, was present in this area, with interruptions, until the late 12th century. In AD 841, the Saracens ravaged the Lower Kotor . Emperor Constantine Porphyrogenitus describes this event in the 10th century and refers to the town as Dekatera. At the end of the 10th century, emperor Samuil burned down the town. Kotor became part of the Slavic Doclea in the second half of the 11th century, and, according to the Byzantine historian Skilica, king Mihailo held his court there. In 1260s, Kotor assumed position of an independent town in the foreign politics. It fell under Nemanjic rule in 1186, and for almost two centuries of their reign, it had enjoyed the favour of rulers and a privileged position in the state. It was Hungarian from 1371 to 1384 and Bosnian under king Tvrtko from 1384 to 1391. For a brief period, Kotor was an independent city-republic, and in 1420, it placed itself under the Venetian rule , which is to last for almost four centuries. The town experienced the greatest prosperity between the 12th and the early 15th centuries.

The position of Kotor in the furthest recess of the Gulf of Kotor (Boka Kotorska) is perfect for a harbour sheltered from all strong winds, so this must have been one of the main reasons for establishing the first settlement. On the example of Kotor we can see how all available natural conditions were used to the maximum in positioning the town and planning its defense: a location by the sea, two running waters (the Škurda River in the south and Gurdic spring in the north) in the lower part of the town, while the upper part, with the fortification at the top of inaccessible cliff of St. Ivan hill (260 m), is separated from Mountain Lovcen massif by a deep gorge.

According to the Kotor Statute, dating from the early 14th century, the town occupied the present-day area already at that time, while its fortification system was being gradually constructed between the 9th and 19th centuries. The oldest preserved parts of the medieval ramparts can only be seen in two localities in the south part of the town, near the sea and near the north town gate. Remaining parts of the ramparts near the sea, as well as the ones in the hillside, acquired its present appearance in the Venetian period.

Kotor has largely preserved its urban matrix formed in the Middle Ages. The network of streets is irregular and rather indented. Within the town walls, not much medieval architecture from the period before the Venetian rule has been preserved. The oldest Book of Notaries of Kotor documented totally 17 churches and monasteries in the period from 1326 to1337. Six of them have survived until nowadays: the Cathedral of St. Tryphon, the Church of St. Luke, St. Mary on-the-river or St. Mary Collegiate Church, St. Paul's, St. Anne's and St. Michael's Churches. Of profane architecture, only parts of older buildings have been preserved inserted into new objects, mainly in the street leading from the north town gate to the south one, along the very foot of the hill, as well as the remains of Buca and Drago Palaces .