After the fall of the Roman Empire, Italy was seized by the Ostrogoths, followed in the 6th century by a brief reconquest under Byzantine Emperor Justinian. The invasion of another Germanic tribe, the Lombards, late in the same century, reduced the Byzantine presence to the Exarchate of Ravenna and started the end of political unity of the peninsula for the next 1,300 years.
The Lombard kingdom was subsequently absorbed into the Frankish Empire by Charlemagne in the late 8th century. The Franks also helped the formation of the Papal States in central Italy. Until the 13th century, Italian politics was dominated by the relations between the Holy Roman Emperors and the Papacy, with most of the Italian city-states siding for the former ( Ghibellines) or for the latter (Guelphs) from momentary convenience. , built by German Emperor Frederick II.]] It was during this chaotic era that Italy saw the rise of a peculiar institution, the medieval commune.
Given the power vacuum caused by extreme territorial fragmentation and the struggle between the Empire and the Holy See, local communities sought autonomous ways to restore law and order. In 1176 a league of city-states, the Lombard League, defeated the German emperor Frederick Barbarossa at the Battle of Legnano, thus ensuring effective independence for most of northern and central Italian cities. In coastal and southern areas, the maritime republics, the most notable being Venice, Genoa, Pisa and Amalfi, heavily involved in the Crusades, grew to eventually dominate the Mediterranean and monopolise trade routes to the Orient. In the south, Sicily had become an Islamic emirate in the 9th century, thriving until the Italo-Normans conquered it in the late 11th century together with most of the Lombard and Byzantine principalities of southern Italy.
Through a complex series of events, southern Italy developed as a unified kingdom, first under the House of Hohenstaufen, then under the Capetian House of Anjou and, from the 15th century, the House of Aragon. In Sardinia, the former Byzantine provinces became independent states known as Giudicati, although some parts of the island were under Genoese or Pisan control until the Aragonese conquered it in the 15th century.
The Black Death pandemic of 1348 left its mark on Italy by killing perhaps one third of the population. However, the recovery from the plague led to a resurgence of cities, trade and economy which allowed the bloom of Humanism and Renaissance, that later spread in Europe.