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.
Lombard rule ended with the invasion of Charlemagne in 773, who established the Kingdom of Italy and the Papal States in large parts of Northern and Central Italy. This set the precedent for the main political conflict in Italy over the following centuries, between the Pope and the Holy Roman Emperor, culminating with conflict between Pope Gregory VII and Henry IV and the latter's "Walk to Canossa" in 1077.