In the first centuries of the early Middle Ages various barbarian tribes invaded Istria. The invasion of the Avars and Lombards lasted for a brief period and they did not remain in Istria, but the Slavs spread throughout the peninsula and settled in many parts of its interior. In 788 Istria became part of the Franconian state that introduced the feudal system, encouraged the settling of the Slavs, often on land owned by towns. Thus, towns began to lose their autonomy (based upon classical legal norms) and their power declined, whereas at the same time the power of the Church increased, since the rule of Charlemagne depended on it.
As a result of the decrease of power of the Franconian state and its division into smaller territories, Istria first became part of the Italic Empire, in 952 part of the duchy of Bavaria, in 976 it became part of the duchy of Carinthia, and finally in the 11th century it became an independent region under the jurisdiction of the church, i.e. Patriarch of Aquileia (northern Italy) and partly under German feudal families. Various interests (Church, German nobles,Venetian Republic) constantly led to new clashes, plunder and destruction throughout the entire Istrian peninsula. The unprotected peasants were those to suffer the greatest damage.
Towns in the interior of Istria were most often situated on the very hill tops, a position offering a natural protection. Due to frequent attacks of neighbouring feudal lords or Venice, the towns added a fortification system consisting of town walls and numerous towers and fortresses, often with a drawbridge. Although it resembled a fortress from the outside, the medieval town was intertwined with winding streets that followed the circular arrangement of the walls, whereas the nucleus of town life was the church and square.
Town loggias began to appear in the late medieval period, with the strengthening of urban culture. This was the meeting place of townspeople, place where decisions were reached by the town authorities. They were used for all forms of public life. If loggias were located outside the walls beside the entrance towers or gate, they offered shelter to passengers when the town gate was closed.
Towns, especially the coastal ones with predominantly Latin autochthonous population aspired to autonomy that would enable further development and progress. However, the feudal system opposed such aspirations. During the 11th and 12th centuries, freed partly from the oppression of feudal lords, gradual economic development began, which was in some degree a result of the Crusades. That period is marked by the development of olive and wine growing, fishing, salt production and other trade, particularly maritime trade.
The progress and development of coastal towns did not suit Venice, the city-state that aimed at becoming the major maritime and trading force in the Adriatic. To ensure free navigation for their ships along the eastern coast of the Adriatic, and stay and supply in ports, the Venetians made every effort to take control of all major points along that route. Finally in the 15th century they managed to gain control of all Istrian and Dalmatian towns (except Dubrovnik).