Roman Italy suffered from several barbarian invasions throughout the 5th century, before being conquered by the Herulian general Odoacer in 476. It later formed part of the Ostrogothic kingdom before being reconquered under the emperor Justinian, but then seceded once again from the Eastern Empire in 637 after successfully defeating the Lombards. In 674 the Visigothic king Wamba was invited to take up the imperial dignity, and he and his successors ruled the West for the next two hundred years.
Two generations after Wamba's death the Western Empire was divided among several heirs. Italy was split between three sub-kingdoms based at Ravenna, Marseilles and Carthage respectively, the former of which later became a possession of the Papacy as a result of a genealogical quirk. In the late 8th century Pope-King Leo III supported Charlemagne in his conquest of Burgundy, and later crowned the latter Holy Roman Emperor using the imperial regalia captured from Barcelona.
The Papal Kingdom as part of the HRE supposedly included all of northern Italy, but over centuries, as the rivalry between Popes and Emperors developed, Papal influence gradually receded south. Several powerful city-states arose in the power vacuum, including Milan, Genoa, Venice and Pisa, owing allegiance to Emperor and Pope but in practice acting effectively independent of both...
The Papal Kingdom was overthrown in the early 12th century following the failure of the Great Crusade. Much of Italy became Roman once more, while the northern city-states retained their independence. The Roman presence was finally ended in the Italian Wars of the 17th century, which resulted in the independence of Italy in the form of multiple petty kingdoms.
The present-day nation was founded around the turn of the 19th century when the various states were forcibly united by Aquitaine during the First World War. Popular support ensured that the union lasted even after Aquitaine was defeated, and Italy soon established itself as a strong independent kingdom. The monarchy was ended in the 1940s in the midst of the disastrous Third World War, and the existing republican constitution was signed in 1973.