From 756 to 857, the papacy shifted from the orbit of the Byzantine Empire to that of the kings of the Franks. Pepin the Short (ruled 751–768), Charlemagne (r. 768–814) (co-ruler with his brother Carloman I until 771), and Louis the Pious (r. 814-840) had considerable influence in the selection and administration of popes. The "Donation of Pepin" (756) ratified a new period of papal rule in central Italy, which became known as the Papal States.
This shift was initiated by the Lombards conquering the Exarchate of Ravenna from the Byzantines, strengthened by the Frankish triumph over the Lombards, and ended by the fragmentation of the Frankish Kingdom into West Francia, Middle Francia, and East Francia. Lothair I continued to rule Middle Francia which included much of the Italian peninsula, from 843 to 855.
This period was "a critical time in Rome's transformation from ancient capital to powerful bishopric to new state capital." The period was characterized by "battles between Franks, Lombards and Romans for control of the Italian peninsula and of supreme authority within Christendom."
Following the death of Zachary, the last culturally Greek pope, Stephen II (752-757) became the first pope to cross the Alps, in 752, when he appealed in person for the aid of Pepin the Short upon his election, following the Lombard takeover of Ravenna in 751. The Lombards had extinguished the exarchate of Ravenna and turned their attention to the formerly Byzantine Duchy of Rome. Stephen II had asked Constantinople for help, but the Eastern Romans had their own problems, so he traveled all the way to the palatium at Quierzy, where the reluctant Frankish nobles finally gave their consent to a campaign in Lombardy. For his part, then and there, Pepin executed in writing a promise to convey to the Papacy certain territories that were going to be wrested from the Lombards. No actual document has been preserved, but later 8th century sources quote from it. Fulfilling his part, in Paris Stephen anointed him as King of the Franks in a lavish ceremony at the Basilica of St Denis, bestowing upon him the additional title of patricius Romanorum (Patrician of the Romans). The "Donation of Pepin" strengthened the claim of the popes to the de facto core of the Papal States, and thus the incentives for secular interference in papal selection.
Stephen II's brother and successor was Pope Paul I (757-767). According to the Catholic Encyclopedia:
The death of Paul I was followed by a bloody schism characterized by Toto, the dux of Nepi, and Pope Stephen III (768-772). Toto supported the claim of his layman brother, Antipope Constantine; a small group of Lombards also supported the rival claim of a monk named Philip. Toto invaded Rome. According to the Catholic Encyclopedia, "through the support of the brothers Charlemagne and Carloman, Kings of the Franks, Stephen was able to recover some territories from the Lombards." However, the Lombard King Desiderius married his daughter to Charlemagne, and "in some mysterious manner effected the fall of the pope's chief ministers, Christopher and Sergius."
After Toto had his eyes gouged out and was imprisoned, Stephen III decreed that the entire Roman clergy had the right to elect the pope but restricted eligibility for election to the cardinal-priests and cardinal-deacons (incidentally, the first use of the term "cardinals" to refer to the priests of the titular churches or the seven deacons); the cardinal-bishops, supporters of Toto, were excluded. The Roman laity quickly regained its role after Stephen III's decree, and maintained its participation until 1059. The "papal elections of the following decade were a series of battles between secular and ecclesiastical groups, entangled obliquely in larger Italian and Frankish politics."
Pope Adrian I (772-795) and Pope Leo III (795-816) were elected under the rules of Stephen III, but the latter was forced from Rome and sought the aid of Charlemagne. Under the rule of Adrian I, Charlemagne conquered Pavia, ending the Lombard kingdom "and the Papacy was forever delivered from its persistent and hereditary foe." Adrian I played a pivotal role in the fall of Pavia, and scholars have long assumed that he consistently supported the Frankish efforts to destroy Lombard power; however, the actual situation might be more complicated. Charlemagne confirmed the election of Leo III, sending Angilbert, Abbot of St. Regnier, to Rome to carry to the new Pope admonitions about the proper filling of his office. Leo III was consecrated the day after his election, an unusual move perhaps intended to preempt any Frankish interference.
Pope Stephen IV (816-817) required the Romans to take an oath to Charlemagne's son, Louis the Pious, as their suzerain, and he sent notice of his election to him before traveling to France to crown Louis. Pope Paschal I (817-824) sent "several ambassadors in rapid succession" to Louis before receiving from him the Pactum Ludovicianum, confirming the Donation of Pepin.
After two unanimous elections, Louis the Pious intervened in a bitterly disputed election in favor of Pope Eugene II (824-827). According to the Catholic Encyclopedia, "the election of Eugene II was a triumph for the Franks" and Louis "accordingly sent his son Lothair to Rome to strengthen the Frankish influence." The pope and emperor signed a concordat or constitution in 824. The papal subjects were made to swear fealty to Louis and Lothair and were not to "suffer the pope-elect to be consecrated save in the presence of the emperor's envoys." This was approximately the status quo circa 769, reincorporating the lay Roman nobles (who continued to dominate the process for 200 years) and requiring the pope to swear loyalty to the Frankish ruler.
The consecration of Pope Gregory IV (827-844) was delayed for six months to attain the assent of Louis. Gregory IV was the candidate of the "secular nobility of Rome who were then securing a preponderating influence in papal elections" and thus "the representatives in Rome of the Emperor Louis the Pious" required this delay. Because of this delay, Gregory IV could not begin to govern the church until March 828.
The clergy and the nobles elected different candidates in 844. Because Pope Sergius II (844-847) was, "after a disputed election, consecrated without any reference to the Emperor Lothaire, the latter was indignant, and sent his son Louis with an army to examine into the validity of the election." Only when "Sergius succeeded in pacifying Louis, whom he crowned king", did Lothair I side with Sergius II, the noble candidate.
Three years later Pope Leo IV (847-855) was consecrated, again without imperial approval, which would have been difficult in any case as the Carolingian Empire was in the process of breaking up. Lothair II of Lotharingia indeed failed to impose his own candidate, Pope Benedict III (855-858), in 855 until the Roman-elected candidate refused the office (the first recorded historical refusal). According to the Catholic Encyclopedia:
Lothair II was present for the election of Pope Nicholas I (858-867), who prohibited anyone outside of the Roman community from interfering in papal elections, and as a result Pope Adrian II (867-872) was consecrated without even informing the Franks. Lothair II's choice of Nicholas I was contrary to the wishes of the clergy, but "was confirmed without much ado" and Nicholas I was crowned in the emperor's presence.
According to the Catholic Encyclopedia, Adrian II "strove to maintain peace among the greedy and incompetent descendants of Charlemagne." Pope Marinus I (882-884) was consecrated "without waiting for the consent of the incompetent emperor, Charles the Fat." Pope Stephen V (885-891) was similarly consecrated, and Charles the Fat may have intervened had Stephen V not been elected unanimously.
The coins of Pope Romanus (879) continued to bear the name of Emperor Lambert as well as his own monogram. A synod in Rome decided that Pope John IX (898-900) should not be consecrated except in the presence of "imperial envoys."
It was during the time of Charlemagne that it became customary for the pope to approve the creation of a new archdiocese and to determine its geographic extent. These changes "made the archbishop seem more like the pope's deputy with a delegated share of the universal primacy." Of course, powerful rulers continued to establish their own archdiocese—for example, Otto I, Holy Roman Emperor, created Magdeburg in 963, and Henry II, Holy Roman Emperor, created Bamberg in 1020—and to strongly influence decisions nominally made by the pope. Pope Gregory IV (822-844) was unsuccessful in 830 when he attempted to side with Lothair I and his bishops against Louis the Pious. Disputes such as these lead to the Pseudo-Isidorian Decretals, a forgery of the ilk of the "Donation of Constantine."
The coronations of Pepin, Charlemagne, and Louis by popes planted the idea among generations of European rulers that the pope could confer legitimacy to the title of "emperor."