The Kingdom of Italy (Latin: Regnum Italiae or Regnum Italicum, Italian: Regno d'Italia) was one of the constituent kingdoms of the Holy Roman Empire, along with the kingdoms of Germany, Bohemia, and Burgundy. It comprised northern and central Italy, but excluded the Republic of Venice. Its original capital was Pavia until the 11th century.
In 773, Charlemagne, the King of the Franks, crossed the Alps to invade the Kingdom of the Lombards, which encompassed all of Italy except the Duchy of Rome and some Byzantine possessions in the south. In June 774, the kingdom collapsed and the Franks became masters of northern Italy. The southern areas remained under Lombard control in the Duchy of Benevento. Charlemagne adopted the title "King of the Lombards" and in 800 had himself crowned "Emperor of the Romans" in Rome. Members of the Carolingian dynasty continued to rule Italy until the deposition of Charles the Fat in 887, after which they once briefly regained the throne in 894–96. Until 961, the rule of Italy was continually contested by several aristocratic families from both within and without the kingdom.
In 961, King Otto I of Germany, already married to Adelaide, widow of a previous king of Italy, invaded the kingdom and had himself crowned in Pavia on 25 December. He continued on to Rome, where he had himself crowned emperor on 7 February 962. The union of the crowns of Italy and Germany with that of the so-called "Empire of the Romans" created the Holy Roman Empire, to which Burgundy was added in 1032. From this point on the Holy Roman Emperor was usually also King of Italy and Germany, although emperors sometimes appointed their heirs to rule in Italy and occasionally the Italian bishops and noblemen elected a king of their own in opposition to that of Germany. The absenteeism of the Italian monarch led to the rapid disappearance of central government in the High Middle Ages, but the idea that Italy was a kingdom within the Empire remained and emperors frequently sought to impose their will on the evolving Italian city-states. The resulting wars between Guelphs and Ghibellines, the anti-imperialist and imperialist factions, respectively, were characteristic of Italian politics in the 12th-14th centuries. The Lombard League was the most famous example of this situation; though not a declared separatist movement, it openly challenged the emperor's claim to power.
By the 15th century, the power of the city-states was largely broken. A series of wars in Lombardy from 1423 to 1454 further reduced the number of competing states in Italy. The next forty years were relatively peaceful in Italy, but in 1494 the peninsula was invaded by France. The resulting Great Italian Wars lasted until 1559, when control of most of the Italian states passed to King Philip II of Spain. The Spanish branch of the Habsburg dynasty - the same dynasty of which another branch provided the Emperors - continued to rule most of imperial Italy down to the War of the Spanish Succession (1701-14). After the Imperial Reform of 1495-1512, the Italian kingdom corresponded to the unencircled territories south of the Alps. Juridically the emperor maintained an interest in them as nominal king and overlord, but the "government" of the kingdom consisted in little more than the plenipotentiaries the emperor appointed to represent him and those governors he appointed to rule his own Italian states. Imperial rule in Italy came to an end with the campaigns of the French Revolutionaries in 1792-97, when a series of client republics were set up. In 1806, the Holy Roman Empire was dissolved by the last emperor, Francis II, after its defeat by Napoleon at the Battle of Austerlitz.
Emperor Charles V (King of Spain as Carlos I) was the last emperor to be crowned king of Italy, or to use the title (28 June 1519 to 27 August 1556).
The Peace of Westphalia, in 1648, formally ended the rule of the Holy Roman Emperors in Italy. However, the empire continued to claim territory in northern Italy until its dissolution in 1806.