stately power, providing essential services (ex. food for the needy) and protecting Rome from Lombard incursions; in this way, the popes started building an independent state. Early Middle Ages (8th to 9th centuries) Collapse of the Exarchate At the end of the 8th century the popes definitely aspired to independence, and found a way to achieve it by allying with the Carolingian dynasty of the Franks: the Carolingians needed someone who could give legitimacy to a coup against the powerless Merovingian kings, while the popes needed military protection against the Lombards. In 751 the Lombards seized Ravenna and the Exarchate of Ravenna was abolished. This ended the Byzantine presence in central Italy (although some coastal cities and some areas in south Italy remained under Byzantine control until the 11th century). Facing a new Lombard offensive, the papacy appealed to the Franks for aid. In 756 Frankish forces defeated the Lombards and gave the papacy legal authority over all of central Italy, thus creating the Papal States. However, the remainder of Italy stayed under Lombard (such as Benevento and Spoleto) or Byzantine (such as Calabria, Apulia and Sicily) control. The Frankish (Carolingian) Empire In 774, upon a Papal invitation, the Franks invaded the Kingdom of Italy and finally annexed the Lombards; as a reward the Frankish king Charlemagne received papal support. Later, on December 25, 800, Charlemagne was also crowned emperor of the Holy Roman Empire by the pope, triggering controversy and disputes over the Roman name. A war between the two empires soon followed; in 812 the Byzantines agreed to recognize the existence of two Roman Empires in return for an assurance that the remaining Byzantine possessions in Italy would be uncontested. Throughout this period, some coastal regions, and all of southern Italy, remained under Byzantine or Lombard control. The imperial authority never extended much south of the Italian Peninsula. Southern Italy was divided amongst the two Lombards duchies of Spoleto and Benevento, who accepted Charlemagne's suzerainty only formally (812), and the Byzantine Empire. Coastal cities like Gaeta, Amalfi, Naples on the Tyrrhenian Sea, and Venice on the Adriatic Sea, were enclaves who were becoming increasingly independent from Byzantium. A conquest of Benevento, otherwise, would have meant the total encompassment of the Papal territories, and probably Charlemagne thought it was good for his relationships with the Pope to avoid such a move. The age of Charlemagne was one of stability