Medieval communes in the European Middle Ages had sworn allegiances of mutual defense among the citizens of a town or city. These took many forms and varied widely in organization and makeup.
Defensive towers at San Gimignano, Tuscany, bear witness to the factional strife within communes.
The defence of the Carroccio during the battle of Legnano (1176) by Amos Cassioli (1832–1891)
The history of Italy in the Middle Ages can be roughly defined as the time between the collapse of the Western Roman Empire and the Italian Renaissance. Late antiquity in Italy lingered on into the 7th century under the Ostrogothic Kingdom and the Byzantine Empire under the Justinian dynasty, the Byzantine Papacy until the mid 8th century. The "Middle Ages" proper begin as the Byzantine Empire was weakening under the pressure of the Muslim conquests, and most of the Exarchate of Ravenna finally fell under Lombard rule in 751. From this period, former states that were part of the Exarchate and were not conquered by the Lombard Kingdom, such as the Duchy of Naples, became de facto independent states, having less and less interference from the Eastern Roman Empire.
Expansion of the Frankish Empire: Blue = realm of Pippin III in 758, Orange = expansion under Charlemagne until 814, Yellow = marches and dependencies
Castle of Itri, probably dating from Docibilis I's reign.
Louis II at the capture of Bari, 871, from Houze's Atlas Universel Historique et Geographique (1850)
Medieval Kingdom of Italy, outlined in red, in the 12th and 13th centuries